public interface JsonArrayValidationSet extends JsonObjectValidationSet
VALIDATION_CODE_BLANK, VALIDATION_CODE_CAN_BE_CONVERTED_TO, VALIDATION_CODE_EMAIL, VALIDATION_CODE_EQUIVALENT, VALIDATION_CODE_EQUIVALENT_OR_GREATER, VALIDATION_CODE_EQUIVALENT_OR_LESS, VALIDATION_CODE_GREATER, VALIDATION_CODE_IS_OF_TYPE, VALIDATION_CODE_LENGTH, VALIDATION_CODE_LESS, VALIDATION_CODE_MAX_LENGTH, VALIDATION_CODE_MAX_SIZE, VALIDATION_CODE_MIN_LENGTH, VALIDATION_CODE_MIN_SIZE, VALIDATION_CODE_NOT_AN_ARRAY, VALIDATION_CODE_NOT_BLANK, VALIDATION_CODE_NOT_EQUIVALENT, VALIDATION_CODE_NOT_NULL, VALIDATION_CODE_NOT_PATTERN, VALIDATION_CODE_NULL, VALIDATION_CODE_PATTERN, VALIDATION_CODE_SIZE, VALIDATION_CODE_WHOLE_ARRAY_VALIDATION_RESULT_TYPE| Modifier and Type | Method and Description |
|---|---|
JsonArrayValidationBuilderKey |
validation(SimpleValidator validator)
Starts a validation using a
custom
SimpleValidator. |
JsonArrayValidationBuilderKey |
validationBlank()
Starts the creation of a "must be blank" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToBigDecimal()
Starts the creation of a "can be converted to a BigDecimal" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToBoolean()
Starts the creation of a "can be converted to a Boolean" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToByteArray()
Starts the creation of a "can be converted to a byte[]" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToDate()
Starts the creation of a "can be converted to a Date" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToDouble()
Starts the creation of a "can be converted to a Double" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToFloat()
Starts the creation of a "can be converted to a Float" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToInteger()
Starts the creation of a "can be converted to an Integer" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToJsonArray()
Starts the creation of a "can be converted to a JsonArray" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToJsonObject()
Starts the creation of a "can be converted to a JsonObject" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToLong()
Starts the creation of a "can be converted to a Long" validation.
|
JsonArrayValidationBuilderKey |
validationCanBeConvertedToString()
Starts the creation of a "can be converted to a String" validation.
|
JsonArrayValidationBuilderKey |
validationEmail()
Starts the creation of a "email" validation.
|
JsonArrayValidationBuilderKey |
validationEquivalent(Object reference)
Starts the creation of a "equivalent" validation.
|
JsonArrayValidationBuilderKey |
validationEquivalentOrGreater(Object reference)
Starts the creation of a "equivalent or greater" validation.
|
JsonArrayValidationBuilderKey |
validationEquivalentOrLess(Object reference)
Starts the creation of a "equivalent or less" validation.
|
JsonArrayValidationBuilderKey |
validationGreater(Object reference)
Starts the creation of a "greater than" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeBigDecimalOrNull()
Starts the creation of a "is of type BigDecimal or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeBooleanOrNull()
Starts the creation of a "is of type Boolean or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeByteArrayOrNull(boolean acceptBase64StringToo)
Starts the creation of a "is of type byte[] or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeDateOrNull()
Starts the creation of a "is of type Date or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeDoubleOrNull()
Starts the creation of a "is of type Double or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeFloatOrNull()
Starts the creation of a "is of type Float or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeIntegerOrNull()
Starts the creation of a "is of type Integer or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeJsonArrayOrNull()
Starts the creation of a "is of type JsonArray or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeJsonObjectOrNull()
Starts the creation of a "is of type JsonObject or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeLongOrNull()
Starts the creation of a "is of type Long or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeOrNull(Class<?> referenceType)
Starts the creation of a "is of type or null" validation.
|
JsonArrayValidationBuilderKey |
validationIsOfTypeStringOrNull()
Starts the creation of a "is of type String or null" validation.
|
JsonArrayValidationBuilderKey |
validationLength(int length)
Starts the creation of a "length" validation.
|
JsonArrayValidationBuilderKey |
validationLess(Object reference)
Starts the creation of a "less than" validation.
|
JsonArrayValidationBuilderKey |
validationMaxLength(int maxLength)
Starts the creation of a "maximum length" validation.
|
JsonArrayValidationBuilderKey |
validationMaxSize(int maxSize,
boolean ignoreNullValues)
Starts the creation of a "maximum size" validation.
|
JsonArrayValidationBuilderKey |
validationMinLength(int minLength)
Starts the creation of a "minimum length" validation.
|
JsonArrayValidationBuilderKey |
validationMinSize(int minSize,
boolean ignoreNullValues)
Starts the creation of a "minimum size" validation.
|
JsonArrayValidationBuilderKey |
validationNotBlank()
Starts the creation of a "not blank" validation.
|
JsonArrayValidationBuilderKey |
validationNotEquivalent(Object reference)
Starts the creation of a "not equivalent" validation.
|
JsonArrayValidationBuilderKey |
validationNotNull()
Starts the creation of a "not null" validation.
|
JsonArrayValidationBuilderKey |
validationNotPattern(String pattern)
Starts the creation of a "pattern must not match" validation.
|
JsonArrayValidationBuilderKey |
validationNull()
Starts the creation of a "must be null" validation.
|
JsonArrayValidationBuilderKey |
validationPattern(String pattern)
Starts the creation of a "pattern must match" validation.
|
JsonArrayValidationBuilderKey |
validationSize(int size,
boolean ignoreNullValues)
Starts the creation of a "size" validation.
|
addError, addMessage, addMessage, addSuccess, addWarning, convertToJsonObject, createValidationSet, getMessages, getMessages, getMessagesFormatted, getMessagesFormatted, hasMessages, hasMessages, isError, isError, isSuccess, isSuccess, isValid, isValid, isWarning, isWarning, mergeValidationSet, mergeValidationSet, prefixValidationKeysJsonArrayValidationBuilderKey validation(SimpleValidator validator)
ValidationSetSimpleValidator.
This is useful when you have a validator that can be reuse in different contexts (as the ones provided by Spincast).
If you need full control over a validation, the number of
generated Messages for example, then you can instead run your
validations as you wish
and use #addMessage(ValidationMessage) and other
similar methods to add the resulting validation Messages to the
set.
validation in interface JsonObjectValidationSetvalidation in interface ValidationSetJsonArrayValidationBuilderKey validationNotBlank()
ValidationSetvalidationNotBlank in interface JsonObjectValidationSetvalidationNotBlank in interface ValidationSetJsonArrayValidationBuilderKey validationBlank()
ValidationSetvalidationBlank in interface JsonObjectValidationSetvalidationBlank in interface ValidationSetJsonArrayValidationBuilderKey validationEmail()
ValidationSetvalidationEmail in interface JsonObjectValidationSetvalidationEmail in interface ValidationSetJsonArrayValidationBuilderKey validationNull()
ValidationSetvalidationNull in interface JsonObjectValidationSetvalidationNull in interface ValidationSetJsonArrayValidationBuilderKey validationNotNull()
ValidationSetvalidationNotNull in interface JsonObjectValidationSetvalidationNotNull in interface ValidationSetJsonArrayValidationBuilderKey validationPattern(String pattern)
ValidationSetvalidationPattern in interface JsonObjectValidationSetvalidationPattern in interface ValidationSetJsonArrayValidationBuilderKey validationNotPattern(String pattern)
ValidationSetvalidationNotPattern in interface JsonObjectValidationSetvalidationNotPattern in interface ValidationSetJsonArrayValidationBuilderKey validationSize(int size, boolean ignoreNullValues)
ValidationSetvalidationSize in interface JsonObjectValidationSetvalidationSize in interface ValidationSetignoreNullValues - If true, null values will
be ignored in the total count. For example, if the size validation
is done on a JsonArray which is [null, null "abc"],
the size would be 3 if ignoreNullValues is false
and 1 if it's true.JsonArrayValidationBuilderKey validationMinSize(int minSize, boolean ignoreNullValues)
ValidationSetvalidationMinSize in interface JsonObjectValidationSetvalidationMinSize in interface ValidationSetignoreNullValues - If true, null values will
be ignored in the total count. For example, if the size validation
is done on a JsonArray which is [null, null "abc"],
the size would be 3 if ignoreNullValues is false
and 1 if it's true.JsonArrayValidationBuilderKey validationMaxSize(int maxSize, boolean ignoreNullValues)
ValidationSetvalidationMaxSize in interface JsonObjectValidationSetvalidationMaxSize in interface ValidationSetignoreNullValues - If true, null values will
be ignored in the total count. For example, if the size validation
is done on a JsonArray which is [null, null "abc"],
the size would be 3 if ignoreNullValues is false
and 1 if it's true.JsonArrayValidationBuilderKey validationLength(int length)
ValidationSetvalidationLength in interface JsonObjectValidationSetvalidationLength in interface ValidationSetJsonArrayValidationBuilderKey validationMinLength(int minLength)
ValidationSet
A null value returns false, otherwise
toString() is called on the other object to
check its "length".
validationMinLength in interface JsonObjectValidationSetvalidationMinLength in interface ValidationSetJsonArrayValidationBuilderKey validationMaxLength(int maxLength)
ValidationSet
A null value returns true, otherwise
toString() is called on the other object to
check its "length".
validationMaxLength in interface JsonObjectValidationSetvalidationMaxLength in interface ValidationSetJsonArrayValidationBuilderKey validationEquivalent(Object reference)
ValidationSet
To validate if an element is equivalent to another,
one is converted to the type of the other if this is required.
If this conversion fails, they are not equivalent. When both
elements are of the same types, the #equals(Object)
method is used to compre them.
The exact logic to determine if two elements are equivalent
can be found in ObjectConverter.isEquivalent(Object, Object).
validationEquivalent in interface JsonObjectValidationSetvalidationEquivalent in interface ValidationSetJsonArrayValidationBuilderKey validationNotEquivalent(Object reference)
ValidationSet
To validate if an element is equivalent to another,
one is converted to the type of the other if this is required.
If this conversion fails, they are not equivalent. When both
elements are of the same types, the #equals(Object)
method is used to compre them.
The exact logic to determine if two elements are equivalent
can be found in ObjectConverter.isEquivalent(Object, Object).
validationNotEquivalent in interface JsonObjectValidationSetvalidationNotEquivalent in interface ValidationSetJsonArrayValidationBuilderKey validationLess(Object reference)
ValidationSet
To validate if an element is less than another,
one is converted to the type of the other if this is required.
If this conversion fails, they can't be compared.
The resulting type must implement the Comparable interface,
so the Comparable.compareTo(Object) method is
used to compare the two elements.
null is always less than a non-null element.
validationLess in interface JsonObjectValidationSetvalidationLess in interface ValidationSetJsonArrayValidationBuilderKey validationGreater(Object reference)
ValidationSet
To validate if an element is greater than another,
one is converted to the type of the other if this is required.
If this conversion fails, they can't be compared.
The resulting type must implement the Comparable interface,
so the Comparable.compareTo(Object) method is
used to compare the two elements.
null is always less than a non-null element.
validationGreater in interface JsonObjectValidationSetvalidationGreater in interface ValidationSetJsonArrayValidationBuilderKey validationEquivalentOrLess(Object reference)
ValidationSet
To validate if an element is equivalent or less than another,
one is converted to the type of the other if this is required.
If this conversion fails, they can't be compared.
The resulting type must implement the Comparable interface,
so the Comparable.compareTo(Object) method is
used to compare the two elements.
null is always less than a non-null element.
validationEquivalentOrLess in interface JsonObjectValidationSetvalidationEquivalentOrLess in interface ValidationSetJsonArrayValidationBuilderKey validationEquivalentOrGreater(Object reference)
ValidationSet
To validate if an element is equivalent or greater than another,
one is converted to the type of the other if this is required.
If this conversion fails, they can't be compared.
The resulting type must implement the Comparable interface,
so the Comparable.compareTo(Object) method is
used to compare the two elements.
null is always less than a non-null element.
validationEquivalentOrGreater in interface JsonObjectValidationSetvalidationEquivalentOrGreater in interface ValidationSetJsonArrayValidationBuilderKey validationIsOfTypeOrNull(Class<?> referenceType)
validationIsOfTypeOrNull in interface JsonObjectValidationSetreferenceType - the type to validate agains.JsonArrayValidationBuilderKey validationIsOfTypeStringOrNull()
validationIsOfTypeStringOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeIntegerOrNull()
validationIsOfTypeIntegerOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeLongOrNull()
validationIsOfTypeLongOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeFloatOrNull()
validationIsOfTypeFloatOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeDoubleOrNull()
validationIsOfTypeDoubleOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeBooleanOrNull()
validationIsOfTypeBooleanOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeBigDecimalOrNull()
validationIsOfTypeBigDecimalOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeByteArrayOrNull(boolean acceptBase64StringToo)
validationIsOfTypeByteArrayOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeDateOrNull()
validationIsOfTypeDateOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeJsonObjectOrNull()
validationIsOfTypeJsonObjectOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationIsOfTypeJsonArrayOrNull()
validationIsOfTypeJsonArrayOrNull in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToString()
validationCanBeConvertedToString in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToInteger()
validationCanBeConvertedToInteger in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToLong()
validationCanBeConvertedToLong in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToFloat()
validationCanBeConvertedToFloat in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToBoolean()
validationCanBeConvertedToBoolean in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToDate()
validationCanBeConvertedToDate in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToDouble()
validationCanBeConvertedToDouble in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToBigDecimal()
validationCanBeConvertedToBigDecimal in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToByteArray()
validationCanBeConvertedToByteArray in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToJsonObject()
validationCanBeConvertedToJsonObject in interface JsonObjectValidationSetJsonArrayValidationBuilderKey validationCanBeConvertedToJsonArray()
validationCanBeConvertedToJsonArray in interface JsonObjectValidationSetCopyright © 2017. All rights reserved.