Szymon Haxik
Szymon Haxik

Reputation: 141

Gson avoid reflection

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

Answers (1)

mbonnin
mbonnin

Reputation: 7032

You can use Autovalue and Autovalue-gson that will create a reflection free adapter for you.

Upvotes: 2

Related Questions