public interface JsonObjectValidationSet extends ValidationSet
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 |
|---|---|
JsonObjectValidationBuilderKey |
validation(SimpleValidator validator)
Starts a validation using a
custom
SimpleValidator. |
JsonObjectValidationBuilderKey |
validationBlank()
Starts the creation of a "must be blank" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToBigDecimal()
Starts the creation of a "can be converted to a BigDecimal" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToBoolean()
Starts the creation of a "can be converted to a Boolean" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToByteArray()
Starts the creation of a "can be converted to a byte[]" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToDate()
Starts the creation of a "can be converted to a Date" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToDouble()
Starts the creation of a "can be converted to a Double" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToFloat()
Starts the creation of a "can be converted to a Float" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToInteger()
Starts the creation of a "can be converted to an Integer" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToJsonArray()
Starts the creation of a "can be converted to a JsonArray" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToJsonObject()
Starts the creation of a "can be converted to a JsonObject" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToLong()
Starts the creation of a "can be converted to a Long" validation.
|
JsonObjectValidationBuilderKey |
validationCanBeConvertedToString()
Starts the creation of a "can be converted to a String" validation.
|
JsonObjectValidationBuilderKey |
validationEmail()
Starts the creation of a "email" validation.
|
JsonObjectValidationBuilderKey |
validationEquivalent(Object reference)
Starts the creation of a "equivalent" validation.
|
JsonObjectValidationBuilderKey |
validationEquivalentOrGreater(Object reference)
Starts the creation of a "equivalent or greater" validation.
|
JsonObjectValidationBuilderKey |
validationEquivalentOrLess(Object reference)
Starts the creation of a "equivalent or less" validation.
|
JsonObjectValidationBuilderKey |
validationGreater(Object reference)
Starts the creation of a "greater than" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeBigDecimalOrNull()
Starts the creation of a "is of type BigDecimal or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeBooleanOrNull()
Starts the creation of a "is of type Boolean or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeByteArrayOrNull(boolean acceptBase64StringToo)
Starts the creation of a "is of type byte[] or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeDateOrNull()
Starts the creation of a "is of type Date or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeDoubleOrNull()
Starts the creation of a "is of type Double or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeFloatOrNull()
Starts the creation of a "is of type Float or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeIntegerOrNull()
Starts the creation of a "is of type Integer or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeJsonArrayOrNull()
Starts the creation of a "is of type JsonArray or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeJsonObjectOrNull()
Starts the creation of a "is of type JsonObject or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeLongOrNull()
Starts the creation of a "is of type Long or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeOrNull(Class<?> referenceType)
Starts the creation of a "is of type or null" validation.
|
JsonObjectValidationBuilderKey |
validationIsOfTypeStringOrNull()
Starts the creation of a "is of type String or null" validation.
|
JsonObjectValidationBuilderKey |
validationLength(int length)
Starts the creation of a "length" validation.
|
JsonObjectValidationBuilderKey |
validationLess(Object reference)
Starts the creation of a "less than" validation.
|
JsonObjectValidationBuilderKey |
validationMaxLength(int maxLength)
Starts the creation of a "maximum length" validation.
|
JsonObjectValidationBuilderKey |
validationMaxSize(int maxSize,
boolean ignoreNullValues)
Starts the creation of a "maximum size" validation.
|
JsonObjectValidationBuilderKey |
validationMinLength(int minLength)
Starts the creation of a "minimum length" validation.
|
JsonObjectValidationBuilderKey |
validationMinSize(int minSize,
boolean ignoreNullValues)
Starts the creation of a "minimum size" validation.
|
JsonObjectValidationBuilderKey |
validationNotBlank()
Starts the creation of a "not blank" validation.
|
JsonObjectValidationBuilderKey |
validationNotEquivalent(Object reference)
Starts the creation of a "not equivalent" validation.
|
JsonObjectValidationBuilderKey |
validationNotNull()
Starts the creation of a "not null" validation.
|
JsonObjectValidationBuilderKey |
validationNotPattern(String pattern)
Starts the creation of a "pattern must not match" validation.
|
JsonObjectValidationBuilderKey |
validationNull()
Starts the creation of a "must be null" validation.
|
JsonObjectValidationBuilderKey |
validationPattern(String pattern)
Starts the creation of a "pattern must match" validation.
|
JsonObjectValidationBuilderKey |
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, prefixValidationKeysJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey validationNotBlank()
ValidationSetvalidationNotBlank in interface ValidationSetJsonObjectValidationBuilderKey validationBlank()
ValidationSetvalidationBlank in interface ValidationSetJsonObjectValidationBuilderKey validationEmail()
ValidationSetvalidationEmail in interface ValidationSetJsonObjectValidationBuilderKey validationNull()
ValidationSetvalidationNull in interface ValidationSetJsonObjectValidationBuilderKey validationNotNull()
ValidationSetvalidationNotNull in interface ValidationSetJsonObjectValidationBuilderKey validationPattern(String pattern)
ValidationSetvalidationPattern in interface ValidationSetJsonObjectValidationBuilderKey validationNotPattern(String pattern)
ValidationSetvalidationNotPattern in interface ValidationSetJsonObjectValidationBuilderKey validationSize(int size, boolean ignoreNullValues)
ValidationSetvalidationSize 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.JsonObjectValidationBuilderKey validationMinSize(int minSize, boolean ignoreNullValues)
ValidationSetvalidationMinSize 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.JsonObjectValidationBuilderKey validationMaxSize(int maxSize, boolean ignoreNullValues)
ValidationSetvalidationMaxSize 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.JsonObjectValidationBuilderKey validationLength(int length)
ValidationSetvalidationLength in interface ValidationSetJsonObjectValidationBuilderKey validationMinLength(int minLength)
ValidationSet
A null value returns false, otherwise
toString() is called on the other object to
check its "length".
validationMinLength in interface ValidationSetJsonObjectValidationBuilderKey validationMaxLength(int maxLength)
ValidationSet
A null value returns true, otherwise
toString() is called on the other object to
check its "length".
validationMaxLength in interface ValidationSetJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey 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 ValidationSetJsonObjectValidationBuilderKey validationIsOfTypeOrNull(Class<?> referenceType)
referenceType - the type to validate agains.JsonObjectValidationBuilderKey validationIsOfTypeStringOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeIntegerOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeLongOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeFloatOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeDoubleOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeBooleanOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeBigDecimalOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeByteArrayOrNull(boolean acceptBase64StringToo)
JsonObjectValidationBuilderKey validationIsOfTypeDateOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeJsonObjectOrNull()
JsonObjectValidationBuilderKey validationIsOfTypeJsonArrayOrNull()
JsonObjectValidationBuilderKey validationCanBeConvertedToString()
JsonObjectValidationBuilderKey validationCanBeConvertedToInteger()
JsonObjectValidationBuilderKey validationCanBeConvertedToLong()
JsonObjectValidationBuilderKey validationCanBeConvertedToFloat()
JsonObjectValidationBuilderKey validationCanBeConvertedToBoolean()
JsonObjectValidationBuilderKey validationCanBeConvertedToDate()
JsonObjectValidationBuilderKey validationCanBeConvertedToDouble()
JsonObjectValidationBuilderKey validationCanBeConvertedToBigDecimal()
JsonObjectValidationBuilderKey validationCanBeConvertedToByteArray()
JsonObjectValidationBuilderKey validationCanBeConvertedToJsonObject()
JsonObjectValidationBuilderKey validationCanBeConvertedToJsonArray()
Copyright © 2017. All rights reserved.