almost.functional
public final class Predicates extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
and(Predicate<? super T> first,
Predicate<? super T> second)
Create a predicate which is a logical and of two existing predicate.
|
static <T> Predicate<T> |
contains(java.lang.Iterable<T> iterable)
Returns a predicate that that tests if an iterable contains an argument.
|
static <T> Predicate<T> |
isEqual(T targetRef)
Returns a predicate that tests if two arguments are equal according to Objects.equals(Object, Object).
|
static <T> Predicate<T> |
negate(Predicate<? super T> predicate)
Negate an existing predicate's test result.
|
static Predicate<java.lang.String> |
notEmptyString()
Predicate to check that a String is not empty, i.e.
|
static <T> Predicate<T> |
notNull()
Predicate to check that a value is not null.
|
static <T> Predicate<T> |
or(Predicate<? super T> first,
Predicate<? super T> second)
Create a predicate which is a logical or of two existing predicate.
|
public static Predicate<java.lang.String> notEmptyString()
public static <T> Predicate<T> notNull()
T
- Type of the valuepublic static <T> Predicate<T> isEqual(T targetRef)
T
- the type of arguments to the predicatetargetRef
- the object reference with which to compare for equality, which may be nullpublic static <T> Predicate<T> contains(java.lang.Iterable<T> iterable)
T
- the type of the argument to the predicateiterable
- the iterable, may not be nullpublic static <T> Predicate<T> negate(Predicate<? super T> predicate)
T
- type of the predicate.predicate
- An existing predicate.public static <T> Predicate<T> and(Predicate<? super T> first, Predicate<? super T> second)
T
- type of the predicatesfirst
- first predicate.second
- second predicate.public static <T> Predicate<T> or(Predicate<? super T> first, Predicate<? super T> second)
T
- type of the predicatesfirst
- first predicate.second
- second predicate.