@Override public JSONObject toJSON() { JSONObject a = new JSONObject(); a.put("stages", stages != null ? stages.toJSON() : null); a.put("post", postBuild != null ? postBuild.toJSON() : null); a.put("environment", environment != null ? environment.toJSON() : null); a.put("agent", agent != null ? agent.toJSON() : null); a.put("tools", tools != null ? tools.toJSON() : null); if (options != null && !options.getOptions().isEmpty()) { a.put("options", options.toJSON()); } else { a.put("options", null); } if (parameters != null && !parameters.getParameters().isEmpty()) { a.put("parameters", parameters.toJSON()); } else { a.put("parameters", null); } if (triggers != null && !triggers.getTriggers().isEmpty()) { a.put("triggers", triggers.toJSON()); } else { a.put("triggers", null); } if (libraries != null && !libraries.getLibs().isEmpty()) { a.put("libraries", libraries.toJSON()); } else { a.put("libraries", null); } return new JSONObject().accumulate("pipeline", a); }
@Override public JSONObject toJSON() { JSONObject a = new JSONObject(); a.put("stages", stages != null ? stages.toJSON() : null); a.put("post", postBuild != null ? postBuild.toJSON() : null); a.put("environment", environment != null ? environment.toJSON() : null); a.put("agent", agent != null ? agent.toJSON() : null); a.put("tools", tools != null ? tools.toJSON() : null); if (options != null && !options.getOptions().isEmpty()) { a.put("options", options.toJSON()); } else { a.put("options", null); } if (parameters != null && !parameters.getParameters().isEmpty()) { a.put("parameters", parameters.toJSON()); } else { a.put("parameters", null); } if (triggers != null && !triggers.getTriggers().isEmpty()) { a.put("triggers", triggers.toJSON()); } else { a.put("triggers", null); } if (libraries != null && !libraries.getLibs().isEmpty()) { a.put("libraries", libraries.toJSON()); } else { a.put("libraries", null); } return new JSONObject().accumulate("pipeline", a); }
o.accumulate("parallel", parallel.toJSON()); } else { final JSONArray a = new JSONArray();
o.accumulate("stages", stages.toJSON());