I have a simple POJO class Defect:
import lombok.Getter; import lombok.Setter; import lombok.ToString; @Setter @Getter @ToString public class Defect { private String formattedId; private String fixedInBuild; private String foundInBuild; private String verifiedInBuild; private String state; private String resolution; private String submittedBy; private String priority; private String severity; } And I am trying to convert a Gson.JsonObject to Defect. The JsonObject looks like this:
I want to store only specific fields hence not all added in the POJO.
But new GsonBuilder().create().fromJson(object, Defect.class) returns a Defect object with all null values. What is wrong here?

GsonBuilderbefore thecreate.