package com.gh.gamecenter.entity

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

class ServerEntity : Parcelable {

    var server: String? = null
    var time: Long = 0
    var tag: String? = null

    override fun describeContents(): Int {
        return 0
    }

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

    constructor() {}

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

    companion object {

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

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