Read and write Json properties using methods (ie. getters & setters)
Author: GoogleCodeExporterCreated Mar 19, 2015Updated Aug 18, 2026
LabelsenhancementPriority-Mediumauto-migratedType-EnhancementMilestone-Undefined
if your object has an int getId(); method. Maybe you want to have a
@Field("id")
public int getId();
When the Json is generated the getId() method is called and the result is
placed in "id"
I know that I could have a int field in my class, but, in my case the Id is
generate by Hibernate once the object is saved.
Original issue reported on code.google.com by Germanattanasio on 7 Sep 2010 at 2:04
Source: google/gson