Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
and(Predicate<? super T> p1,
Predicate<? super T> p2)
Applies logical AND to predicates.
|
static <T> Predicate<T> |
negate(Predicate<? super T> p1)
Applies logical negation to predicate.
|
static <T> Predicate<T> |
or(Predicate<? super T> p1,
Predicate<? super T> p2)
Applies logical OR to predicates.
|
static <T> Predicate<T> |
safe(ThrowablePredicate<? super T,java.lang.Throwable> throwablePredicate)
Creates a safe
Predicate . |
static <T> Predicate<T> |
safe(ThrowablePredicate<? super T,java.lang.Throwable> throwablePredicate,
boolean resultIfFailed)
Creates a safe
Predicate . |
static <T> Predicate<T> |
xor(Predicate<? super T> p1,
Predicate<? super T> p2)
Applies logical XOR to predicates.
|
public static <T> Predicate<T> and(Predicate<? super T> p1, Predicate<? super T> p2)
T
- the type of the input to the functionp1
- the first predicatep2
- the second predicatePredicate
java.lang.NullPointerException
- if p1
or p2
is nullpublic static <T> Predicate<T> or(Predicate<? super T> p1, Predicate<? super T> p2)
T
- the type of the input to the functionp1
- the first predicatep2
- the second predicatePredicate
java.lang.NullPointerException
- if p1
or p2
is nullpublic static <T> Predicate<T> xor(Predicate<? super T> p1, Predicate<? super T> p2)
T
- the type of the input to the functionp1
- the first predicatep2
- the second predicatePredicate
java.lang.NullPointerException
- if p1
or p2
is nullpublic static <T> Predicate<T> negate(Predicate<? super T> p1)
T
- the type of the input to the functionp1
- the predicate to be negatedPredicate
java.lang.NullPointerException
- if p1
is nullpublic static <T> Predicate<T> safe(ThrowablePredicate<? super T,java.lang.Throwable> throwablePredicate)
Predicate
.T
- the type of the input to the functionthrowablePredicate
- the predicate that may throw an exceptionPredicate
or false
if exception was thrownpublic static <T> Predicate<T> safe(ThrowablePredicate<? super T,java.lang.Throwable> throwablePredicate, boolean resultIfFailed)
Predicate
.T
- the type of the input to the functionthrowablePredicate
- the predicate that may throw an exceptionresultIfFailed
- the result which returned if exception was thrownPredicate
or resultIfFailed
java.lang.NullPointerException
- if throwablePredicate
is null