I have the following POJO class for a JSON object:
public class JSONChangeSet {
public JSONChangeSet {
System.out.println("Owner: " + owner);
}
@SerializedName("comment")
private String comment;
@SerializedName("lastUpdatedDate")
private String modifiedDate;
@SerializedName("owner")
private Resource owner;
@SerializedName("modifiedBy")
private Resource modifier;
public String getComment() {
return comment;
}
}
Obviously this doesnt work, because the field owner has not yet a value assigned when the constructor is called. Is there any possibility to call a method automatically after the JSON object is parsed?