January 2018
Beginner to intermediate
354 pages
7h 59m
English
The Java object get and set methods are convenient for passing single parameters to test methods that do not require an object parameter. The user must build into the JSON object all these get and set methods. We covered them earlier, but let's review an example:
/** * Sample Register Employee Java Object * * @author Name * */public class RegisterEmployee { private String id; private JSONObject address; private JSONObject phone; public RegisterEmployee(JSONObject object) throws Exception { setId(object.get("id").toString()); setAddress((JSONObject) object.get("address")); setPhone((JSONObject) object.get("phone")); } public void setId(String id) { this.id = id; } public String getId() { return id;
Read now
Unlock full access