This is the json String:
{
new : "",
xx : "yy",
......
}
java, for the key new
,
private String new;
is illegal.
How to write my domain Class?
This is the json String:
{
new : "",
xx : "yy",
......
}
java, for the key new
,
private String new;
is illegal.
How to write my domain Class?
How to write my domain Class?
Since new
is a keyword in java hence you can't use it as variable name. You can use annotation SerializedName
that that indicates this member should be serialized to JSON with the provided name value as its field name.
Sample Domain class:
class NewDetail{
@SerializedName(value="new")
private String newValue;
private String xx;
// getter & setter
}