T - Type of the data to be tested using this check.public abstract class Check<T> extends Object
| Constructor and Description |
|---|
Check() |
| Modifier and Type | Method and Description |
|---|---|
<U extends T> |
and(Check<? super U> operand)
Compose this check with another one using logical AND operator.
|
static <T> Result |
evaluate(T data,
Check<? super T> check) |
static <T> Result |
evaluate(T data,
Check<? super T> check,
ResultFactory resultFactory) |
protected abstract Result |
evaluate(T data,
ResultFactory factory)
Abstract method to delegate implementation of specific check logic to subclasses.
|
<U extends T> |
or(Check<? super U> operand)
Compose this check with another one using logical OR operator.
|
static <T> boolean |
that(T data,
Check<? super T> check)
Assert the data using provided check.
|
static <T> boolean |
that(T data,
Check<? super T> check,
ResultFactory resultFactory)
Assert the data using provided check.
|
abstract String |
toString()
Enforce to implement toString() in every subclass.
|
protected abstract Result evaluate(T data, ResultFactory factory)
data - Tested data.public abstract String toString()
public <U extends T> Check<U> and(Check<? super U> operand)
U - Type of the data tested by other check. It may cause up-cast.operand - Another check.public <U extends T> Check<U> or(Check<? super U> operand)
U - Type of the data tested by other check. It may cause up-cast.operand - Another check.@End(message="Check is not used. Pass it either to Assert.that(), Check.that() or Check.evaluate().")
public static <T> boolean that(T data,
Check<? super T> check)
T - Type of the tested data.data - Tested data.check - Check to be applied.@End(message="Check is not used. Pass it either to Assert.that(), Check.that() or Check.evaluate().")
public static <T> boolean that(T data,
Check<? super T> check,
ResultFactory resultFactory)
T - Type of the tested data.data - Tested data.check - Check to be applied.public static <T> Result evaluate(T data, Check<? super T> check, ResultFactory resultFactory)
Copyright © 2021. All rights reserved.