I want a POJO to contain a Status field (only two possible values SUCCESS, FAILED) and depending on this status, the second field needs to be
What should be the data type of the second field in POJO?
public class MyBean {
private Status status,
private ??? body
}
JSON is also a String, So you can define it as String itself.
When exchanging data between a browser and a server, the data is mostly text and represented in JSON format.
public class MyBean {
private Status status;
private String body;
}