@Override
public JSONObject toJSON() {
final JSONObject o = new JSONObject();
o.accumulate("message", message.toJSON());
if (id != null) {
o.accumulate("id", id.toJSON());
}
if (ok != null) {
o.accumulate("ok", ok.toJSON());
}
if (submitter != null) {
o.accumulate("submitter", submitter.toJSON());
}
if (submitterParameter != null) {
o.accumulate("submitterParameter", submitterParameter.toJSON());
}
if (!parameters.isEmpty()) {
final JSONObject p = new JSONObject();
final JSONArray a = new JSONArray();
for (ModelASTBuildParameter parameter : parameters) {
a.add(parameter.toJSON());
}
p.accumulate("parameters", a);
o.accumulate("parameters", p);
}
return o;
}