package com.gh.gamecenter.feature.entity

import android.os.Parcel
import android.os.Parcelable
import com.google.gson.annotations.SerializedName

class TestEntity : Parcelable {

    var type: String? = null
    var text: String? = null
    var start: Long = 0
    var end: Long = 0

    @SerializedName("game_tag")
    var gameTag: String? = null

    @SerializedName("game_info")
    var gameInfo: String? = null

    @SerializedName("start_midnight")
    val testTime: Long? = null

    override fun describeContents(): Int {
        return 0
    }

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

    constructor()

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

    companion object {

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

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