@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getCondition() != null ? getCondition().hashCode() : 0); result = 31 * result + (getBranch() != null ? getBranch().hashCode() : 0); return result; } }
@Override public void removeSourceLocation() { super.removeSourceLocation(); for (ModelASTBuildCondition condition : conditions) { condition.removeSourceLocation(); } }
@Override public String toGroovy() { StringBuilder result = new StringBuilder(getName()); result.append(" {\n"); for (ModelASTBuildCondition condition : conditions) { result.append(condition.toGroovy()).append('\n'); } result.append("}\n"); return result.toString(); }
/** * Construct the new {@link ClosureExpression} for the given build condition. */ @Nonnull public final ClosureExpression handleBuildCondition(@Nonnull ModelASTBuildCondition condition, @Nonnull ClosureExpression body) { body.setCode(handleBranch(condition.getBranch())); return body; }
@Override public JSONObject toJSON() { final JSONArray a = new JSONArray(); for (ModelASTBuildCondition condition: conditions) { a.add(condition.toJSON()); } return new JSONObject().accumulate("conditions", a); }
@Override public void validate(@Nonnull final ModelValidator validator) { validator.validateElement(this); for (ModelASTBuildCondition condition: conditions) { condition.validate(validator); } super.validate(validator); }
@Override public JSONObject toJSON() { final JSONArray a = new JSONArray(); for (ModelASTBuildCondition condition: conditions) { a.add(condition.toJSON()); } return new JSONObject().accumulate("conditions", a); }
@Override public void validate(final ModelValidator validator) { validator.validateElement(this); for (ModelASTBuildCondition condition: conditions) { condition.validate(validator); } super.validate(validator); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getCondition() != null ? getCondition().hashCode() : 0); result = 31 * result + (getBranch() != null ? getBranch().hashCode() : 0); return result; } }
@Override public void removeSourceLocation() { super.removeSourceLocation(); for (ModelASTBuildCondition condition : conditions) { condition.removeSourceLocation(); } }
@Override public String toGroovy() { StringBuilder result = new StringBuilder(getName()); result.append(" {\n"); for (ModelASTBuildCondition condition : conditions) { result.append(condition.toGroovy()).append('\n'); } result.append("}\n"); return result.toString(); }
@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; } ModelASTBuildCondition that = (ModelASTBuildCondition) o; if (getCondition() != null ? !getCondition().equals(that.getCondition()) : that.getCondition() != null) { return false; } return getBranch() != null ? getBranch().equals(that.getBranch()) : that.getBranch() == null; }
@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; } ModelASTBuildCondition that = (ModelASTBuildCondition) o; if (getCondition() != null ? !getCondition().equals(that.getCondition()) : that.getCondition() != null) { return false; } return getBranch() != null ? getBranch().equals(that.getBranch()) : that.getBranch() == null; }