package com.gh.gamecenter.entity

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by khy on 14/09/17.
 */

class UserDataLibaoEntity : Parcelable {

    var code: String? = null

    var type: String? = null

    var time: Long = 0

    override fun describeContents(): Int {
        return 0
    }

    override fun writeToParcel(dest: Parcel, flags: Int) {
        dest.writeString(this.code)
        dest.writeString(this.type)
        dest.writeLong(this.time)
    }

    constructor() {}

    constructor(code: String?, type: String?, time: Long?) {
        this.code = code
        this.type = type
        if (time != null) {
            this.time = time
        }
    }

    protected constructor(`in`: Parcel) {
        this.code = `in`.readString()
        this.type = `in`.readString()
        this.time = `in`.readLong()
    }

    companion object {

        const val TAG = "UserDataLibaoEntity"

        @JvmField
        val CREATOR: Parcelable.Creator<UserDataLibaoEntity> = object : Parcelable.Creator<UserDataLibaoEntity> {
            override fun createFromParcel(source: Parcel): UserDataLibaoEntity {
                return UserDataLibaoEntity(source)
            }

            override fun newArray(size: Int): Array<UserDataLibaoEntity?> {
                return arrayOfNulls(size)
            }
        }
    }
}
