Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
allOf(Predicate<? super T>... predicates)
A combinator that checks if all of the given
predicates are satisfied. |
static <T> Predicate<T> |
anyOf(Predicate<? super T>... predicates)
A combinator that checks if at least one of the given
predicates is satisfies. |
static <T> Predicate<T> |
instanceOf(Class<? extends T> type)
Creates a
Predicate that tests, if an object is instance of the specified type . |
static <T> Predicate<T> |
is(T value)
Creates a
Predicate that tests, if an object is equal to the specified value using
Objects.equals(Object, Object) for comparison. |
static <T> Predicate<T> |
isIn(T... values)
Creates a
Predicate that tests, if an object is equal to at least one of the specified values
using Objects.equals(Object, Object) for comparison. |
static <T> Predicate<T> |
noneOf(Predicate<? super T>... predicates)
A combinator that checks if none of the given
predicates is satisfied. |
public static <T> Predicate<T> instanceOf(Class<? extends T> type)
Predicate
that tests, if an object is instance of the specified type
.T
- Type of the given type
type
- A typePredicate
NullPointerException
- if type
is nullpublic static <T> Predicate<T> is(T value)
Predicate
that tests, if an object is equal to the specified value
using
Objects.equals(Object, Object)
for comparison.
Hint: Use is(null)
instead of introducing a new predicate isNull()
T
- value typevalue
- A value, may be nullPredicate
@SafeVarargs public static <T> Predicate<T> isIn(T... values)
Predicate
that tests, if an object is equal to at least one of the specified values
using Objects.equals(Object, Object)
for comparison.T
- value typevalues
- an array of values of type TPredicate
NullPointerException
- if values
is null@SafeVarargs public static <T> Predicate<T> allOf(Predicate<? super T>... predicates)
predicates
are satisfied.
By definition allOf
is satisfied if the given predicates
are empty.
T
- clojure over tested object typespredicates
- An array of predicatesPredicate
@SafeVarargs public static <T> Predicate<T> anyOf(Predicate<? super T>... predicates)
predicates
is satisfies.T
- clojure over tested object typespredicates
- An array of predicatesPredicate
@SafeVarargs public static <T> Predicate<T> noneOf(Predicate<? super T>... predicates)
predicates
is satisfied.
Naturally noneOf
is satisfied if the given predicates
are empty.
T
- clojure over tested object typespredicates
- An array of predicatesPredicate
Copyright © 2016. All Rights Reserved.