{
size: {
width: 100,
height: 120
}
}
public class Document {
@SerializedName("size")
@Expose
private JSONObject size;
public JSONObject getSize() {
return size;
}
}
Document document = new Gson().fromJson(json, Document.class);
Log.d(TAG, "size: " + document.getSize()); // size: {}
public class Size {
@SerializedName("width")
@Expose
private String width;
@SerializedName("height")
@Expose
private String height;
public String getWidth() {
return width;
}
public String getHeight() {
return height;
}
}