T - The value type.java.util.function.Predicate<T>AbstractStringChecker, HasNoDoubleSpaces, HasNoInnerSpaces, HasNoOuterSpaces, HasNoSpaces, IsConvertibleUsing, IsExistingDirectory, IsExistingFile, IsGreaterOrEqual, IsGreaterThan, IsInRange, IsInstanceOf, IsLessOrEqual, IsLessThan, IsNotNull, IsPattern, LengthIsInRange, MatchesPattern, RawRefChecker, RefCheckerpublic interface Checker<T>
extends java.util.function.Predicate<T>
| Modifier and Type | Method | Description |
|---|---|---|
default <S> Checker<S> |
after(Converter<S,? extends T> converter) |
Creates a checkers that checks that a value is convertible from a source type
to a target type, then matches a checker of the target type.
|
default <S> Checker<S> |
after(java.util.function.Function<S,? extends T> function,
java.lang.Class<S> sourceClass) |
Creates a checkers that checks that a value is convertible from a source type
to a target type, then matches a checker of the target type.
|
default Checker<?> |
afterRaw(Converter<?,?> converter) |
|
default Checker<T> |
and(Checker<? super T> other) |
Returns a checker that is the logical AND composition of this checker with another one.
|
default Checker<T> |
andRaw(Checker<?> other) |
|
default Checker<T> |
cast(Checker<?> other) |
|
default <V> Checker<V> |
cast(java.lang.Class<V> cls) |
|
default java.lang.String |
explain() |
|
java.lang.String |
explain(boolean result,
java.lang.String arg) |
Explains the conditions at which a positive or negative result is obtained.
|
default java.lang.String |
explain(java.lang.String arg) |
|
static <S> Checker<S> |
fromConverter(Converter<S,?> converter) |
Creates a checker from a converter.
|
static <S,T> Checker<S> |
fromFunction(java.util.function.Function<S,?> function,
java.lang.Class<S> sourceClass,
java.lang.Class<T> targetClass) |
Creates a checker from a function.
|
java.lang.Class<T> |
getValueClass() |
|
default Checker<T> |
negate() |
|
default Checker<T> |
or(Checker<? super T> other) |
Returns a checker that is the logical OR composition of this checker with another one.
|
default Checker<T> |
orRaw(Checker<?> other) |
|
boolean |
test(T value) |
|
default java.lang.String |
testAndExplain(T value) |
Tests a value and explains the result.
|
default java.lang.String |
testAndExplain(T value,
java.lang.String arg) |
Tests a value and explains the result.
|
java.lang.Class<T> getValueClass()
java.lang.String explain(boolean result,
java.lang.String arg)
result - The result to explain.arg - The argument name to use in explanations.result.default java.lang.String explain(java.lang.String arg)
default java.lang.String explain()
default java.lang.String testAndExplain(T value, java.lang.String arg)
value - The tested value.arg - The argument name to use in explanations.value passes or fails the test.
value is represented by arg.default java.lang.String testAndExplain(T value)
value - The tested value.value passes or fails the test.
value is represented by its default string representation.default Checker<T> negate()
negate in interface java.util.function.Predicate<T>default Checker<T> and(Checker<? super T> other)
This checker is evaluated before other.
If this checker evaluates to false, other is not evaluated.
other - The other checker.other.default <V> Checker<V> cast(java.lang.Class<V> cls)
default Checker<T> or(Checker<? super T> other)
This checker is evaluated before other.
If this checker evaluates to true, other is not evaluated.
other - The other checker.other.default <S> Checker<S> after(Converter<S,? extends T> converter)
S - The source type.converter - A converter from a source type to a type
that is compliant with this checker.converter, then this checker.default <S> Checker<S> after(java.util.function.Function<S,? extends T> function, java.lang.Class<S> sourceClass)
S - The source type.function - A function from a source type to a type
that is compliant with this checker.sourceClass - The source class.function, then this checker.static <S> Checker<S> fromConverter(Converter<S,?> converter)
The checker checks that the argument is convertible.
S - The source type.converter - The converter.converter.static <S,T> Checker<S> fromFunction(java.util.function.Function<S,?> function, java.lang.Class<S> sourceClass, java.lang.Class<T> targetClass)
The checker checks that the argument is accepted (convertible) by the function.
S - The source type.T - The target type.function - The function.sourceClass - The source class.targetClass - The target class.function.Copyright © 2019. All rights reserved.