T - Value type.ValidatorImplpublic interface Validator<T>
| Modifier and Type | Method | Description |
|---|---|---|
default <S> Validator<S> |
after(Converter<S,? extends T> converter) |
Creates a validator composed of this one applied after a converter.
|
default <S> Validator<S> |
after(java.util.function.Function<S,? extends T> function,
java.lang.Class<S> sourceClass) |
Creates a validator composed of this one applied after a conversion function.
|
default Validator<?> |
afterRaw(Converter<?,?> converter) |
|
default Validity |
getValidity(T value) |
Returns the validity of a value.
|
default Validity |
getValidityRaw(java.lang.Object value) |
Returns the validity of a raw value.
|
java.lang.Class<T> |
getValueClass() |
|
default java.util.List<ValidationRecord> |
validate(T value,
java.lang.String name) |
Validates a value and returns a list of validation records.
|
void |
validate(T value,
java.lang.String name,
ValidationHandler handler) |
Validates a value.
|
default void |
validate(T value,
java.lang.String name,
java.util.List<ValidationRecord> records) |
Validates a value and adds validation records to a list.
|
default java.util.List<ValidationRecord> |
validateRaw(java.lang.Object value,
java.lang.String name) |
Validates a raw value and returns a list of validation records.
|
default void |
validateRaw(java.lang.Object value,
java.lang.String name,
ValidationHandler handler) |
Validates a raw value.
|
default void |
validateRaw(java.lang.Object value,
java.lang.String name,
java.util.List<ValidationRecord> records) |
Validates a raw value and adds validation records to a list.
|
java.lang.Class<T> getValueClass()
void validate(T value, java.lang.String name, ValidationHandler handler)
value - The value.name - The name that must be given to value in messages.handler - The validation messages handler.default void validate(T value, java.lang.String name, java.util.List<ValidationRecord> records)
value - The value.name - The name that must be given to value in messages.records - The list of validation records that must be filled.java.lang.IllegalArgumentException - When records is null.default java.util.List<ValidationRecord> validate(T value, java.lang.String name)
value - The value.name - The name that must be given to value in messages.default void validateRaw(java.lang.Object value,
java.lang.String name,
ValidationHandler handler)
value - The value.name - The name that must be given to value in messages.handler - The validation messages handler.java.lang.ClassCastException - If value is not null and cannot be assigned to value type T.default void validateRaw(java.lang.Object value,
java.lang.String name,
java.util.List<ValidationRecord> records)
value - The value.name - The name that must be given to value in messages.records - The list of validation records that must be filled.java.lang.IllegalArgumentException - When records is null.java.lang.ClassCastException - If value is not null and cannot be assigned to value type T.default java.util.List<ValidationRecord> validateRaw(java.lang.Object value, java.lang.String name)
value - The value.name - The name that must be given to value in messages.java.lang.ClassCastException - If value is not null and cannot be assigned to value type T.default Validity getValidity(T value)
value - The value.value.default Validity getValidityRaw(java.lang.Object value)
value - The value.value.java.lang.ClassCastException - If value is not null and cannot be assigned to value type T.default <S> Validator<S> after(Converter<S,? extends T> converter)
S - The source type.converter - The converter from source type S to T.converter.java.lang.IllegalArgumentException - When converter is null.default Validator<?> afterRaw(Converter<?,?> converter)
converter - The converter.converter.java.lang.IllegalArgumentException - When converter is null.default <S> Validator<S> after(java.util.function.Function<S,? extends T> function, java.lang.Class<S> sourceClass)
S - The source type.function - The function that converts values from source type S to T.sourceClass - The source class.function.java.lang.IllegalArgumentException - When function or sourceClass is null.Copyright © 2019. All rights reserved.