I have Java POJO class like this:
class Topic {
@SerializedName("id")
long id;
@SerializedName("name")
String name;
}
and I have a Kotlin data class Like this
data class Topic(val id: Long, val name: String)
How to provide the json key
to any variables of the kotlin data class
like the @SerializedName
annotation in java variables ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…