Public class User {
private int code;
private String name;
private int age;
}
Directly through the gson. ToJson (user) can get the following string:
{" code ": 100," name ":" Tom ", "age" : 18}
But how to through the gson library status code and the separation of data required, get the string?
{" code ": 100," data ": {" name" : "Tom", "age" : 18}}