@AssertTrue(message = SPILLER_SPILL_PATH + " must be configured when " + SPILL_ENABLED + " is set to true") public boolean isSpillerSpillPathsConfiguredIfSpillEnabled() { return !isSpillEnabled() || !spillerSpillPaths.isEmpty(); }
public class Driver { @NotNull private String name; @Min(18) private int age; @AssertTrue private boolean hasDrivingLicense; public Driver(String name, int age, boolean hasDrivingLicense) { this.name = name; this.age = age; this.hasDrivingLicense = hasDrivingLicense; } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append( "Driver" ); sb.append( "{name='" ).append( name ).append( '\'' ); sb.append( ", age=" ).append( age ); sb.append( ", hasDrivingLicense=" ).append( hasDrivingLicense ); sb.append( '}' ); return sb.toString(); } }
private boolean value11; @AssertTrue private boolean value12;
@AssertTrue(message = "withMarkers must be set when FileReadingMode is 'lines'") public boolean isWithMarkersMustBeSet() { if (this.withMarkers == null && FileReadingMode.lines == this.fileReadingmode) { return false; } else { return true; } }
@AssertTrue(message = "Exactly one of 'bucket' or 'bucketExpression' must be set") public boolean isMutuallyExclusiveBucketAndBucketExpression() { return (this.bucket != null && this.bucketExpression == null) || (this.bucket == null && this.bucketExpression != null); }
@AssertTrue public Integer getAge() { return age; } }
@AssertTrue(message = "withMarkers can only be supplied when FileReadingMode is 'lines'") public boolean isWithMarkersValid() { if (this.withMarkers != null && FileReadingMode.lines != this.fileReadingmode) { return false; } else { return true; } }
@AssertTrue(message = "filenamePattern and filenameRegex are mutually exclusive") public boolean isExclusivePatterns() { return !(this.filenamePattern != null && this.filenameRegex != null); }
@AssertTrue(message = "Partition key expression and partition key extractor class properties are mutually exclusive.") public boolean isValidPartitionKeyProperty() { return (this.partitionKeyExpression == null) || (this.partitionKeyExtractorClass == null); }
@AssertTrue(message="The person type must be I-human") private boolean isIHuman;
@AssertTrue @JsonIgnore public boolean isValidDpi() { if (size == null || size == Size.NONE) { return true; } return dpi != null; }
@AssertTrue @JsonIgnore public boolean isValidOffsetInMilliseconds() { if (playerActivity == PlayerActivity.IDLE) { return true; } return offsetInMilliseconds != null; }
@AssertTrue(message = "subscription or topic must be set") boolean isValid() { return !Strings.isNullOrEmpty(subscription) || !Strings.isNullOrEmpty(topic); } public boolean discardUnknownFeatures = false;
public static class BasicPropertiesEntity { @NotNull private StringProperty stringProperty = new SimpleStringProperty( null ); @Max(value = 3) private ReadOnlyDoubleWrapper doubleProperty = new ReadOnlyDoubleWrapper( 4.5 ); @Min(value = 3) private IntegerProperty integerProperty = new SimpleIntegerProperty( 2 ); @AssertTrue private ReadOnlyBooleanProperty booleanProperty = new SimpleBooleanProperty( false ); }
@JsonIgnore @AssertTrue(message = "Incorrect value") public boolean isValueNull() { return Arrays.asList(LAST_24_HOURS, LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS).contains(this.operator) ? value == null : value != null; } }
@AssertTrue(message = SPILLER_SPILL_PATH + " must be configured when " + SPILL_ENABLED + " is set to true") public boolean isSpillerSpillPathsConfiguredIfSpillEnabled() { return !isSpillEnabled() || !spillerSpillPaths.isEmpty(); }
/** * User can't explicitly set both script and expression. */ @Override @AssertTrue(message = "the 'script' and 'expression' options are mutually exclusive") public boolean isValid() { // default value for expression is always set; this is safe as profilesToActivate() will activate 'use-script' // if script is non-null return getScript() == null || expression.equals(DEFAULT_EXPRESSION); }
@AssertTrue public Boolean validate(@NotNull String number, @Future Date expiryDate, @NotNull Integer controlNumber, String type) { String lastDigit = validationAlgorithm.validate(number, controlNumber); if (Integer.parseInt(lastDigit.toString()) % 2 == 0) { return true; } else { return false; } }
@AssertTrue public Boolean validate(@NotNull @Valid CreditCard04 creditCard) { String lastDigit = validationAlgorithm.validate(creditCard.getNumber(), creditCard.getControlNumber()); if (Integer.parseInt(lastDigit.toString()) % 2 == 0) { return true; } else { return false; } }
private boolean assertFalse; @AssertTrue private boolean assertTrue;