I'm trying to migrate parcelable model from Java to Kotlin.
My model looks like this:
import kotlinx.parcelize.*
@Parcelize
class SignatureAuthorityModel
(var id: Int,
var cloudId: Int,
var uuid: UUID?): android.os.Parcelable
{
override fun equals(other: Any?): Boolean
{
//equals implementation
}
override fun hashCode(): Int
{
//some hash implementation
}
override fun toString(): String
{
//some stringifier implementation
}
}
I can call writeToParcel for this model, but SignatureAuthorityModel.createFromParcel(parcel) isn't available. Must I write it separately, or must I configure kotlin-parcelize plugin somehow? From kotlin documentation it seems that createFromParcel should also be generated automatically when I use @Parcelize annotation, and that I must write implementation in companion object Creator only if I have some advanced logic. What is the proper way to do it?