Reputation: 141
Is there a way to avoid reflection in Gson? I know that when you will use registerTypeAdapter
you can avoid it, but if you use @SerializedName("name")
annotation on class member, can you avoid id too?
Upvotes: 4
Views: 6263
Reputation: 7032
You can use Autovalue and Autovalue-gson that will create a reflection free adapter for you.
Upvotes: 2