public final class Predicates
extends java.lang.Object
Predicate
interface.Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
and(Predicate<? super T> this_,
Predicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical
AND of the
this_ predicate and another. |
static <T> Predicate<T> |
isEqual(java.lang.Object 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> this_)
Returns a predicate that represents the logical negation of the
this_
predicate. |
static <T> Predicate<T> |
or(Predicate<? super T> this_,
Predicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical
OR of the
this_ predicate and another. |
public static <T> Predicate<T> and(Predicate<? super T> this_, Predicate<? super T> other)
this_
predicate and another. When evaluating the composed
predicate, if the this_
predicate is false
, then the other
predicate is not evaluated.
Any exceptions thrown during evaluation of either predicate are relayed
to the caller; if evaluation of the this_
predicate throws an exception, the
other
predicate will not be evaluated.
T
- the type of the input to the predicatesthis_
- a predicate that will be logically-ANDed with the other
predicateother
- a predicate that will be logically-ANDed with the this_
predicatethis_
predicate and the other
predicatejava.lang.NullPointerException
- if this_
is nulljava.lang.NullPointerException
- if other is nullpublic static <T> Predicate<T> negate(Predicate<? super T> this_)
this_
predicate.T
- the type of the input to the predicatethis_
- the predicate to be negatedthis_
predicatejava.lang.NullPointerException
- if this_
is nullpublic static <T> Predicate<T> or(Predicate<? super T> this_, Predicate<? super T> other)
this_
predicate and another. When evaluating the composed
predicate, if the this_
predicate is true
, then the other
predicate is not evaluated.
Any exceptions thrown during evaluation of either predicate are relayed
to the caller; if evaluation of the this_
predicate throws an exception, the
other
predicate will not be evaluated.
T
- the type of the input to the predicatesthis_
- a predicate that will be logically-ORed with the other
predicateother
- a predicate that will be logically-ORed with the this_
predicatethis_
predicate and the other
predicatejava.lang.NullPointerException
- if this_
is nulljava.lang.NullPointerException
- if other is nullpublic static <T> Predicate<T> isEqual(java.lang.Object targetRef)
Objects.equals(Object, Object)
.T
- the type of arguments to the predicatetargetRef
- the object reference with which to compare for equality,
which may be null
Objects.equals(Object, Object)