I am having a class like following,
public class Student { public int id; public String name; public int age; }
Now I want to c
You can explore the json tree with gson.
Try something like this :
gson.toJsonTree(stu1).getAsJsonObject().remove("id");
You can add some properties also :
gson.toJsonTree(stu2).getAsJsonObject().addProperty("id", "100");