@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + (getArgs() != null ? getArgs().hashCode() : 0); result = 31 * result + (getChildren() != null ? getChildren().hashCode() : 0); return result; } }
@CheckForNull @Override public String validateElement(@Nonnull ModelASTWhenCondition condition, @CheckForNull FlowExecution execution) { if (condition.getName().equals("changelog")) { String pattern = getPatternArgument(condition.getArgs()); if (pattern == null) { return Messages.WhenConditionalValidator_changelog_missingParameter(); } else { try { Pattern.compile(pattern); Pattern.compile(ChangeLogConditional.expandForMultiLine(pattern), Pattern.MULTILINE | Pattern.DOTALL); } catch (PatternSyntaxException e) { return Messages.WhenConditionalValidator_changelog_badPattern(pattern, e.getMessage()); } } } return null; }
@Override public String toGroovy() { StringBuilder result = new StringBuilder(); if (!children.isEmpty()) { result.append(name).append(" {\n"); for (ModelASTWhenContent child : children) { result.append(child.toGroovy()).append("\n"); } result.append("}\n"); } else { result.append(name).append(" ").append(getArgs().toGroovy()); } return result.toString(); }
@Override public String toGroovy() { StringBuilder result = new StringBuilder(); if (!children.isEmpty()) { result.append(name).append(" {\n"); for (ModelASTWhenContent child : children) { result.append(child.toGroovy()).append("\n"); } result.append("}\n"); } else { result.append(name).append(" ").append(getArgs().toGroovy()); } return result.toString(); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + (getArgs() != null ? getArgs().hashCode() : 0); result = 31 * result + (getChildren() != null ? getChildren().hashCode() : 0); return result; } }
@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; } ModelASTWhenCondition that = (ModelASTWhenCondition) o; if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) { return false; } if (getChildren() != null ? !getChildren().equals(that.getChildren()) : that.getChildren() != null) { return false; } return getArgs() != null ? getArgs().equals(that.getArgs()) : that.getArgs() == 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; } ModelASTWhenCondition that = (ModelASTWhenCondition) o; if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) { return false; } if (getChildren() != null ? !getChildren().equals(that.getChildren()) : that.getChildren() != null) { return false; } return getArgs() != null ? getArgs().equals(that.getArgs()) : that.getArgs() == null; }