public final class Checks extends Object
| Modifier and Type | Method and Description |
|---|---|
static Check<Object> |
a(Class<?> expectedClass) |
static <D> Check<D> |
allOf(Check<? super D>... operands) |
static <D> Check<D> |
allOf(Iterable<Check<? super D>> operands) |
static Check<Object> |
an(Class<?> expectedClass) |
static <D> Check<D> |
anyOf(Check<? super D>... operands) |
static <D> Check<D> |
anyOf(Iterable<Check<? super D>> operands) |
static Check<Object> |
anything() |
static <V> CheckBuilder<V,Check<V>> |
as(Class<V> type) |
static <D extends Comparable<D>> |
between(D left,
D right) |
static <D> Check<D> |
between(D left,
D right,
Comparator<D> comparator) |
static <D extends Comparable<D>> |
betweenInclusive(D left,
D right) |
static <D> Check<D> |
betweenInclusive(D left,
D right,
Comparator<D> comparator) |
static Check<BigDecimal> |
closeTo(BigDecimal operand,
BigDecimal precision) |
static Check<Double> |
closeTo(double operand,
double precision) |
static Check<Float> |
closeTo(float operand,
float precision) |
static <D,V> Check<D> |
compose(String name,
Transformation<? super D,V> transformation,
Check<? super V> check) |
static <D> Check<D> |
createBuilder() |
static <D> Check<D> |
createBuilderWith(Check<D> check) |
static <D> CheckDsl<D> |
dsl() |
static <D> Check<D[]> |
emptyArray()
Create matcher of empty array.
|
static <D extends Comparable<D>> |
equalOrLessThan(D operand) |
static <D> Check<D> |
equalOrLessThan(D operand,
Comparator<D> comparator) |
static <D extends Comparable<D>> |
equalOrMoreThan(D operand) |
static <D> Check<D> |
equalOrMoreThan(D operand,
Comparator<D> comparator) |
static Check<BigDecimal> |
equalTo(BigDecimal expectedValue) |
static <D> Check<D> |
equalTo(D expectedValue) |
static Check<Double> |
equalTo(Double expectedValue) |
static Check<Float> |
equalTo(Float expectedValue) |
static <D,V> CheckBuilder<V,Check<D>> |
has(String name,
Transformation<? super D,V> transformation) |
static <D> Check<D> |
check(Predicate<D> predicate,
String expectationDescription) |
static Check<Object> |
instanceOf(Class<?> expectedClass) |
static <D> Check<D> |
is(D expectedValue) |
static Check<Object> |
isA(Class<?> expectedClass) |
static Check<Object> |
isAn(Class<?> expectedClass) |
static Check<Object> |
isNull() |
static <D extends Comparable<D>> |
lessThan(D operand) |
static <D> Check<D> |
lessThan(D operand,
Comparator<D> comparator) |
static Check<Throwable> |
message(Check<? super String> check) |
static <D extends Comparable<D>> |
moreThan(D operand) |
static <D> Check<D> |
moreThan(D operand,
Comparator<D> comparator) |
static <D> Check<D> |
not(D positiveValue) |
static <D> Check<D> |
not(Check<D> positiveCheck) |
static Check<Object> |
notNull() |
static <D> Check<D> |
nullableCondition(Predicate<D> predicate,
String expectationDescription)
Define a transparent check using provided predicate and string expectation description.
|
static <D,V> CheckBuilder<V,Check<D>> |
nullableHas(String name,
Transformation<? super D,V> transformation) |
static <D> Check<D> |
oneOf(Collection<D> alternatives)
Create matcher, that matches, if tested object meets one of provided alternatives (or).
|
static <D> Check<D> |
oneOf(D... alternatives)
Create matcher, that matches, if tested object meets one of provided alternatives (or).
|
static <D> Check<D> |
require(Check<? super D> requirement,
Check<? super D> check) |
static <D> Check<D> |
requireNotNull(Check<D> check) |
static Check<Object> |
sameClass(Class<?> expectedClass) |
static <D> Check<D> |
sameInstance(D expectedInstance) |
static fluent.validation.ThrowingCheck |
throwing(Class<? extends Throwable> condition) |
static fluent.validation.ThrowingCheck |
throwing(Check<? super Throwable> check) |
static <D,V> Check<D> |
transform(Transformation<? super D,V> transformation,
Check<? super V> check) |
static <D> Check<D> |
which(Check<D> check) |
public static <D> Check<D> nullableCondition(Predicate<D> predicate, String expectationDescription)
D - Type of the data to be tested by the created expectation.predicate - Predicate used to test the supplied data.expectationDescription - Function, that provides description of the expectation.public static <D> Check<D> not(D positiveValue)
public static <D> Check<D> oneOf(Collection<D> alternatives)
D - Type of the data to test using this expectation.alternatives - Expected alternatives.@SafeVarargs public static <D> Check<D> oneOf(D... alternatives)
D - Type of the data to test using this expectation.alternatives - Expected alternatives.@SafeVarargs public static <D> Check<D> anyOf(Check<? super D>... operands)
@SafeVarargs public static <D> Check<D> allOf(Check<? super D>... operands)
public static <D> Check<D> equalTo(D expectedValue)
public static <D> Check<D> is(D expectedValue)
public static <D> Check<D> sameInstance(D expectedInstance)
public static <D> Check<D[]> emptyArray()
D - Type of the items in the collection to be tested.public static <D,V> Check<D> transform(Transformation<? super D,V> transformation, Check<? super V> check)
public static <D,V> Check<D> compose(String name, Transformation<? super D,V> transformation, Check<? super V> check)
public static <D,V> CheckBuilder<V,Check<D>> has(String name, Transformation<? super D,V> transformation)
public static <D,V> CheckBuilder<V,Check<D>> nullableHas(String name, Transformation<? super D,V> transformation)
public static <V> CheckBuilder<V,Check<V>> as(Class<V> type)
public static <D> Check<D> lessThan(D operand, Comparator<D> comparator)
public static <D> Check<D> moreThan(D operand, Comparator<D> comparator)
public static <D> Check<D> equalOrLessThan(D operand, Comparator<D> comparator)
public static <D> Check<D> equalOrMoreThan(D operand, Comparator<D> comparator)
public static <D extends Comparable<D>> Check<D> lessThan(D operand)
public static <D extends Comparable<D>> Check<D> moreThan(D operand)
public static <D extends Comparable<D>> Check<D> equalOrLessThan(D operand)
public static <D extends Comparable<D>> Check<D> equalOrMoreThan(D operand)
public static <D extends Comparable<D>> Check<D> between(D left, D right)
public static <D> Check<D> between(D left, D right, Comparator<D> comparator)
public static <D> Check<D> betweenInclusive(D left, D right, Comparator<D> comparator)
public static <D extends Comparable<D>> Check<D> betweenInclusive(D left, D right)
public static Check<BigDecimal> closeTo(BigDecimal operand, BigDecimal precision)
public static Check<BigDecimal> equalTo(BigDecimal expectedValue)
public static fluent.validation.ThrowingCheck throwing(Class<? extends Throwable> condition)
public static <D> Check<D> createBuilder()
public static <D> CheckDsl<D> dsl()
Copyright © 2021. All rights reserved.