Generate adapters based on type, not property
aafanasev opened this issue · comments
@Kson
data class UserEntity(
val firstname: String,
val lastname: String
)
// generated code
...
private val firstnameAdapter by lazy { gson.getAdapter(String::class.java) }
private val lastnameAdapter by lazy { gson.getAdapter(String::class.java) }
...
As you see, each property will have it's own adapter. I think better to have adapters grouped by types, f.ex:
private val stringAdapter by lazy { gson.getAdapter(String::class.java) }
and use this adapter in both properties