@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; } ModelASTKeyValueOrMethodCallPair that = (ModelASTKeyValueOrMethodCallPair) o; if (getKey() != null ? !getKey().equals(that.getKey()) : that.getKey() != null) { return false; } return getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == 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; } ModelASTKeyValueOrMethodCallPair that = (ModelASTKeyValueOrMethodCallPair) o; if (getKey() != null ? !getKey().equals(that.getKey()) : that.getKey() != null) { return false; } return getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == null; }
@Override @CheckForNull public String validateElement(@Nonnull ModelASTOption option, @CheckForNull FlowExecution execution) { if (option.getName() != null && option.getName().equals("preserveStashes")) { for (ModelASTMethodArg arg : option.getArgs()) { if (arg instanceof ModelASTKeyValueOrMethodCallPair) { ModelASTKeyValueOrMethodCallPair namedArg = (ModelASTKeyValueOrMethodCallPair)arg; if (namedArg.getKey().getKey().equals("buildCount")) { if (namedArg.getValue() instanceof ModelASTValue && ((ModelASTValue)namedArg.getValue()).getValue() instanceof Integer) { Integer v = (Integer)((ModelASTValue)namedArg.getValue()).getValue(); if (v < 1 || v > MAX_SAVED_STASHES) { return Messages.PreserveStashesJobProperty_ValidatorImpl_InvalidBuildCount(MAX_SAVED_STASHES); } } } } } } return null; } }