@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getAgentType() != null ? getAgentType().hashCode() : 0); result = 31 * result + (getVariables() != null ? getVariables().hashCode() : 0); return result; }
result.append("pipeline {\n"); if (agent != null) { result.append(agent.toGroovy());
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + (getAgent() != null ? getAgent().hashCode() : 0); result = 31 * result + (getBranches() != null ? getBranches().hashCode() : 0); result = 31 * result + (getWhen() != null ? getWhen().hashCode() : 0); result = 31 * result + (getPost() != null ? getPost().hashCode() : 0); result = 31 * result + (getTools() != null ? getTools().hashCode() : 0); result = 31 * result + (getEnvironment() != null ? getEnvironment().hashCode() : 0); result = 31 * result + (getFailFast() != null ? getFailFast().hashCode() : 0); result = 31 * result + (getParallel() != null ? getParallel().hashCode() : 0); return result; } }
agent.validate(validator);
@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); }
return false; if (getAgent() != null ? !getAgent().equals(that.getAgent()) : that.getAgent() != null) { return false;
@Override public void removeSourceLocation() { super.removeSourceLocation(); for (ModelASTBranch branch: branches) { branch.removeSourceLocation(); } if (agent != null) { agent.removeSourceLocation(); } if (parallel != null) { parallel.removeSourceLocation(); } if (when != null) { when.removeSourceLocation(); } if (post != null) { post.removeSourceLocation(); } if (tools != null) { tools.removeSourceLocation(); } if (environment != null) { environment.removeSourceLocation(); } }
@Override public JSONObject toJSON() { final JSONObject j = new JSONObject(); // Handle JENKINS-43016 - round-trip empty-string label agent into agent any. if (isEmptyStringLabelAgent()) { j.accumulate("type", "any"); } else { j.accumulate("type", agentType.toJSON()); if (variables != null) { if (variables instanceof ModelASTClosureMap && !((ModelASTClosureMap) variables).getVariables().isEmpty()) { j.accumulate("arguments", variables.toJSON()); } else if (variables instanceof ModelASTValue) { j.accumulate("argument", variables.toJSON()); } } } return j; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + (getAgent() != null ? getAgent().hashCode() : 0); result = 31 * result + (getWhen() != null ? getWhen().hashCode() : 0); result = 31 * result + (getPost() != null ? getPost().hashCode() : 0); result = 31 * result + (getTools() != null ? getTools().hashCode() : 0); result = 31 * result + (getEnvironment() != null ? getEnvironment().hashCode() : 0); result = 31 * result + (getStages() != null ? getStages().hashCode() : 0); result = 31 * result + (getBranches() != null ? getBranches().hashCode() : 0); result = 31 * result + (getFailFast() != null ? getFailFast().hashCode() : 0); result = 31 * result + (getParallel() != null ? getParallel().hashCode() : 0); result = 31 * result + (getOptions() != null ? getOptions().hashCode() : 0); result = 31 * result + (getInput() != null ? getInput().hashCode() : 0); result = 31 * result + (getParallelContent() != null ? getParallelContent().hashCode() : 0); return result; } }
public void validate(final ModelValidator validator, boolean isNested) { validator.validateElement(this, isNested); for (ModelASTBranch branch : branches) { branch.validate(validator); } if (parallel != null) { parallel.validate(validator, true); } if (agent != null) { agent.validate(validator); } if (when != null) { when.validate(validator); } if (post != null) { post.validate(validator); } if (tools != null) { tools.validate(validator); } if (environment != null) { environment.validate(validator); } }
@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); }
return false; if (getAgent() != null ? !getAgent().equals(that.getAgent()) : that.getAgent() != null) { return false;
super.removeSourceLocation(); if (agent != null) { agent.removeSourceLocation();
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getAgentType() != null ? getAgentType().hashCode() : 0); result = 31 * result + (getVariables() != null ? getVariables().hashCode() : 0); return result; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getStages() != null ? getStages().hashCode() : 0); result = 31 * result + (getPostBuild() != null ? getPostBuild().hashCode() : 0); result = 31 * result + (getEnvironment() != null ? getEnvironment().hashCode() : 0); result = 31 * result + (getAgent() != null ? getAgent().hashCode() : 0); result = 31 * result + (getTools() != null ? getTools().hashCode() : 0); result = 31 * result + (getOptions() != null ? getOptions().hashCode() : 0); result = 31 * result + (getParameters() != null ? getParameters().hashCode() : 0); result = 31 * result + (getTriggers() != null ? getTriggers().hashCode() : 0); result = 31 * result + (getLibraries() != null ? getLibraries().hashCode() : 0); return result; } }
agent.validate(validator);
result.append(agent.toGroovy());
o.accumulate("agent", agent.toJSON());
return false; if (getAgent() != null ? !getAgent().equals(that.getAgent()) : that.getAgent() != null) { return false;
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } ModelASTAgent that = (ModelASTAgent) o; if (getAgentType() != null ? !getAgentType().equals(that.getAgentType()) : that.getAgentType() != null) { return false; } return getVariables() != null ? getVariables().equals(that.getVariables()) : that.getVariables() == null; }