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> Builder<V,Check<V>> |
as(Class<V> type) |
static Builder<String,Check<Element>> |
attribute(String name) |
static <D extends Comparable<D>> |
between(D left,
D right) |
static <D> Check<D> |
between(D left,
D right,
Comparator<D> comparator) |
static <D> Check<D> |
betweenInclude(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,
Function<? super D,V> function,
Check<? super V> check) |
static <D> Check<D> |
condition(Predicate<D> predicate,
String expectationDescription) |
static Check<String> |
contains(String substring) |
static Check<String> |
containsCaseInsensitive(String substring) |
static <D> Check<D> |
createBuilder() |
static <D> Check<D> |
createBuilderWith(Check<D> check) |
static <D> Check<D[]> |
emptyArray()
Create matcher of empty array.
|
static <D> Check<Collection<D>> |
emptyCollection()
Create matcher of empty collection.
|
static Check<String> |
emptyString() |
static Check<String> |
endsWith(String suffix) |
static Check<String> |
endsWithCaseInsensitive(String suffix) |
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 Check<String> |
equalToCaseInsensitive(String expectedValue) |
static <D> Check<Iterable<D>> |
every(Check<? super D> check) |
static <D> Check<Iterable<D>> |
exactItemsInAnyOrder(Check<? super D>... itemChecks) |
static <D> Check<Iterable<D>> |
exactItemsInAnyOrder(Iterable<Check<? super D>> itemConditions) |
static <D> Check<Iterable<D>> |
exactItemsInOrder(D... expectedItems) |
static <D> Check<Iterable<D>> |
exactItemsInOrder(Check<? super D>... itemChecks) |
static <D> Check<Iterable<D>> |
exactItemsInOrder(Iterable<Check<? super D>> itemConditions) |
static <D> Check<Iterable<D>> |
exists(Check<? super D> check) |
static <D,V> Builder<V,Check<D>> |
has(String name,
Function<? super D,V> function) |
static Check<Element> |
hasAttribute(String name) |
static <D> Check<Collection<D>> |
hasItems(Collection<D> items) |
static <D> Check<Collection<D>> |
hasItems(D... items) |
static <D> Check<Iterable<D>> |
hasItemsInAnyOrder(Collection<Check<? super D>> itemChecks) |
static <D> Check<Iterable<D>> |
hasItemsInAnyOrder(Check<? super D>... itemChecks) |
static <D> Check<Iterable<D>> |
hasItemsInOrder(Check<? super D>... itemChecks) |
static <D> Check<Iterable<D>> |
hasItemsInOrder(Iterable<Check<? super D>> itemConditions) |
static <D> Check<Collection<D>> |
hasSize(int size)
Create matcher of collection size.
|
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<String> |
matches(Pattern pattern) |
static Check<String> |
matchesPattern(String pattern) |
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> Builder<V,Check<D>> |
nullableHas(String name,
Function<? super D,V> function) |
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 Check<String> |
startsWith(String prefix) |
static Check<String> |
startsWithCaseInsensitive(String prefix) |
static <D> Check<Collection<D>> |
subsetOf(Collection<D> superSet)
Create matcher, that matches if tested collection meets subset of provided superset.
|
static <D> Check<Collection<D>> |
subsetOf(D... superSet)
Create matcher, that matches if tested collection meets subset of provided superset.
|
static fluent.validation.ThrowingCheck |
throwing(Class<? extends Throwable> condition) |
static fluent.validation.ThrowingCheck |
throwing(Check<? super Throwable> check) |
static <D> Check<D> |
transparent(CheckVisitor checkVisitor,
Check<D> check) |
static <D> Check<D> |
which(Check<D> check) |
static Check<Document> |
xpath(String xpath) |
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> condition(Predicate<D> predicate, String expectationDescription)
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> Check<Collection<D>> emptyCollection()
D - Type of the items in the collection to be tested.public static <D> Check<Collection<D>> subsetOf(Collection<D> superSet)
D - Type of the items in the collection to be tested.superSet - Superset of expected items.@SafeVarargs public static <D> Check<Collection<D>> subsetOf(D... superSet)
D - Type of the items in the collection to be tested.superSet - Superset of expected items.public static <D> Check<Collection<D>> hasSize(int size)
D - Type of the items in the collection to be tested.size - Expected size of the collection.public static <D> Check<Collection<D>> hasItems(Collection<D> items)
@SafeVarargs public static <D> Check<Collection<D>> hasItems(D... items)
public static <D> Check<Iterable<D>> hasItemsInOrder(Iterable<Check<? super D>> itemConditions)
@SafeVarargs public static <D> Check<Iterable<D>> hasItemsInOrder(Check<? super D>... itemChecks)
public static <D> Check<Iterable<D>> hasItemsInAnyOrder(Collection<Check<? super D>> itemChecks)
@SafeVarargs public static <D> Check<Iterable<D>> hasItemsInAnyOrder(Check<? super D>... itemChecks)
public static <D> Check<Iterable<D>> exactItemsInOrder(Iterable<Check<? super D>> itemConditions)
@SafeVarargs public static <D> Check<Iterable<D>> exactItemsInOrder(Check<? super D>... itemChecks)
@SafeVarargs public static <D> Check<Iterable<D>> exactItemsInOrder(D... expectedItems)
public static <D> Check<Iterable<D>> exactItemsInAnyOrder(Iterable<Check<? super D>> itemConditions)
@SafeVarargs public static <D> Check<Iterable<D>> exactItemsInAnyOrder(Check<? super D>... itemChecks)
public static <D,V> Check<D> compose(String name, Function<? super D,V> function, Check<? super V> check)
public static <D,V> Builder<V,Check<D>> nullableHas(String name, Function<? super D,V> function)
public static Check<Document> xpath(String xpath) throws XPathExpressionException
XPathExpressionExceptionpublic 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> betweenInclude(D left, D right, Comparator<D> comparator)
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> Check<D> transparent(CheckVisitor checkVisitor, Check<D> check)
Copyright © 2018. All rights reserved.