Files
assistant-android/app/src/main/java/com/gh/gamecenter/entity/UserDataEntity.kt

87 lines
2.9 KiB
Kotlin

package com.gh.gamecenter.entity
import android.os.Parcel
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
/**
* Created by khy on 14/09/17.
*/
class UserDataEntity : Parcelable {
@SerializedName("is_game_concerned")
var isGameConcerned: Boolean = false
@SerializedName("is_article_favorite")
var isArticleFavorite: Boolean = false
@SerializedName("is_toolkit_favorite")
var isToolkitFavorite: Boolean = false
@SerializedName("is_comment_own")
var isCommentOwn: Boolean = false
@SerializedName("is_comment_voted")
var isCommentVoted: Boolean = false
@SerializedName("is_answer_commented")
var isAnswerCommented: Boolean = false
@SerializedName("is_answer_comment_voted")
var isAnswerCommentVoted: Boolean = false
@SerializedName("is_version_requested")
var isVersionRequested: Boolean = false
@SerializedName("libao")
var userDataLibaoList: List<UserDataLibaoEntity>? = null
@SerializedName("is_answer_own") // 是否为回答的作者
var isAnswerOwn: Boolean = false
override fun describeContents(): Int {
return 0
}
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeByte(if (this.isGameConcerned) 1.toByte() else 0.toByte())
dest.writeByte(if (this.isArticleFavorite) 1.toByte() else 0.toByte())
dest.writeByte(if (this.isToolkitFavorite) 1.toByte() else 0.toByte())
dest.writeByte(if (this.isCommentOwn) 1.toByte() else 0.toByte())
dest.writeByte(if (this.isCommentVoted) 1.toByte() else 0.toByte())
dest.writeByte(if (this.isAnswerCommented) 1.toByte() else 0.toByte())
dest.writeTypedList(this.userDataLibaoList)
dest.writeByte(if (this.isAnswerOwn) 1.toByte() else 0.toByte())
dest.writeByte(if (this.isAnswerCommentVoted) 1.toByte() else 0.toByte())
}
constructor() {}
protected constructor(`in`: Parcel) {
this.isGameConcerned = `in`.readByte().toInt() != 0
this.isArticleFavorite = `in`.readByte().toInt() != 0
this.isToolkitFavorite = `in`.readByte().toInt() != 0
this.isCommentOwn = `in`.readByte().toInt() != 0
this.isCommentVoted = `in`.readByte().toInt() != 0
this.isAnswerCommented = `in`.readByte().toInt() != 0
this.userDataLibaoList = `in`.createTypedArrayList(UserDataLibaoEntity.CREATOR)
this.isAnswerOwn = `in`.readByte().toInt() != 0
this.isAnswerCommentVoted = `in`.readByte().toInt() != 0
}
companion object {
@JvmField
val CREATOR: Parcelable.Creator<UserDataEntity> = object : Parcelable.Creator<UserDataEntity> {
override fun createFromParcel(source: Parcel): UserDataEntity {
return UserDataEntity(source)
}
override fun newArray(size: Int): Array<UserDataEntity?> {
return arrayOfNulls(size)
}
}
}
}