@AssertTrue(message = SPILLER_SPILL_PATH + " must be configured when " + SPILL_ENABLED + " is set to true") public boolean isSpillerSpillPathsConfiguredIfSpillEnabled() { return !isSpillEnabled() || !spillerSpillPaths.isEmpty(); }
/** * @param validationObject * @param annotate * @return */ private boolean validateTrue(Object validationObject, Annotation annotate) { if (checkNullObject(validationObject)) { return true; } if (checkvalidBooleanTypes(validationObject.getClass()) && !(Boolean) validationObject) { throwValidationException(((AssertTrue) annotate).message()); } return true; }
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 void appendTrueValidator(SourceWriter w, JField field) { AssertTrue trueAnnotation = field.getAnnotation(AssertTrue.class); if (trueAnnotation != null) { w.println(", new AssertTrueValidator(\"%s\")", trueAnnotation.message()); } }
private boolean value11; @AssertTrue private boolean value12;
private void appendTrueValidator(SourceWriter w, JField field) { AssertTrue trueAnnotation = field.getAnnotation(AssertTrue.class); if (trueAnnotation != null) { w.println(", new AssertTrueValidator(\"%s\")", trueAnnotation.message()); } }
@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 = "Exactly one of 'url' or 'urlExpression' is required") public boolean isExactlyOneUrl() { return url == null ^ urlExpression == null; }
@AssertTrue(message = "'delimiters' is not allowed when an 'expression' is provided") public boolean isDelimitersAllowed() { return this.expression == null || this.delimiters == null; }
@AssertTrue public Integer getAge() { return age; } }
@AssertTrue(message = "The truststoreUri and keystoreUri should together be either empty or not!") private boolean isStoreUrisConsistent() { return ((this.truststoreUri == null) && (this.keystoreUri == null)) || ((this.truststoreUri != null) && (this.keystoreUri != null)); }
private static class AssertTrueDummyEntity { @AssertTrue private boolean primitiveBoolean; @AssertTrue private Boolean objectBoolean; public void setPrimitiveBoolean(boolean primitiveBoolean) { this.primitiveBoolean = primitiveBoolean; } public void setObjectBoolean(Boolean objectBoolean) { this.objectBoolean = objectBoolean; } }
@AssertTrue public boolean isShipped() { return false; } }
@AssertTrue(message = "A binding must not set both producer and consumer properties.") public boolean onlyOneOfProducerOrConsumerSet() { return consumer == null || producer == null; }
@AssertTrue(message = "Partition selector class and partition selector expression properties are mutually exclusive.") public boolean isValidPartitionSelectorProperty() { return (this.partitionSelectorClass == null) || (this.partitionSelectorExpression == null); }