I am learning Java and JSR-353. My question is quite forward. Having the method below:
public JsonObject createJsonObject() {
return Json.createObjectBuilder()
.add("address", this.getAddress())
.add("city", this.getCity())
.add("state", this.getState())
.add("postalcode", this.getPostalcode())
.add("country", this.getCountry())
.add("contactNumber", this.getContactNumber())
.add("secondContactNumber",this.getSecondContactNumber())
.build();
}
How do you deal if any of the attributes is NULL?