public final class BinaryPredicates
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> BinaryPredicate<T> |
and(BinaryPredicate<T> leftPredicate,
BinaryPredicate<T> rightPredicate)
Returns a logical 'and' combination of the two binary predicates.
|
static <T> BinaryPredicate<T> |
invert(BinaryPredicate<T> original)
Inverts the given binary predicate.
|
static <T> BinaryPredicate<T> |
not(BinaryPredicate<T> original)
Negates the given binary predicate.
|
public static <T> BinaryPredicate<T> not(BinaryPredicate<T> original)
BinaryPredicate.test(Object, Object)
will return the
logically negated value of the original. For example, if the predicate is '<='
, then this method will
transform the predicate (a <= b) to !(a <= b)
, which is equivalent to (a > b)
.original
- the original predicate.public static <T> BinaryPredicate<T> invert(BinaryPredicate<T> original)
'<='
, then this method will transform
the predicate (a <= b)
to (a >= b)
.original
- the original predicate.public static <T> BinaryPredicate<T> and(BinaryPredicate<T> leftPredicate, BinaryPredicate<T> rightPredicate)
leftPredicate
- the first predicate which shall be part of the and conditionrightPredicate
- the second predicate which shall be part of the and condition