@FunctionalInterface
public interface Verify<T>
Check.| Modifier and Type | Method | Description |
|---|---|---|
void |
check(T value) |
Check the value.
|
static <T> Verify<T> |
that(java.util.function.Predicate<? super T> test,
java.lang.String message) |
Create a verifier based on a predicate and message.
|
static <T> Verify<T> |
that(java.util.function.Predicate<? super T> test,
java.util.function.Function<? super T,java.lang.String> messageProducer) |
Create a verifier based on a predicate and message producer.
|
void check(T value) throws java.lang.Exception
value - value to check, never nulljava.lang.Exceptionstatic <T> Verify<T> that(java.util.function.Predicate<? super T> test, java.lang.String message)
IllegalArgumentException with the given message.T - generic value typetest - test to perform, required. Pass with 'true' and fail with 'false'.message - message to return, required.static <T> Verify<T> that(java.util.function.Predicate<? super T> test, java.util.function.Function<? super T,java.lang.String> messageProducer)
IllegalArgumentException with a message produced based on the checked value.T - generic value typetest - test to perform, required. Pass with 'true' and fail with 'false'.messageProducer - message producer producing the message to return, required.