我想知道在使用Moshi时如何忽略Kotlin类字段.
I've found this answer for Java (Moshi ignore field), that indicates to use the keyword transient as follows
private transient String your_variable_name;
但我在Kotlin 找不到正确的方法.
我想知道在使用Moshi时如何忽略Kotlin类字段.
I've found this answer for Java (Moshi ignore field), that indicates to use the keyword transient as follows
private transient String your_variable_name;
但我在Kotlin 找不到正确的方法.
使用@Transient
注释.
@Transient
private val your_variable_name: String
这里的文档:https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-transient/index.html