| 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> |
and(Predicate<? super T> p1,
Predicate<? super T> p2,
Predicate<? super T>... rest)
Applies logical AND to multiple predicates.
|
static <T> Predicate<T> |
negate(Predicate<? super T> predicate)
Applies logical negation to predicate.
|
static <T> Predicate<T> |
notNull()
Checks that input value is not null.
|
static <T> Predicate<T> |
or(Predicate<? super T> p1,
Predicate<? super T> p2)
Applies logical OR to predicates.
|
static <T> Predicate<T> |
or(Predicate<? super T> p1,
Predicate<? super T> p2,
Predicate<? super T>... rest)
Applies logical OR to multiple 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(@NotNull Predicate<? super T> p1, @NotNull Predicate<? super T> p2)
T - the type of the input to the functionp1 - the first predicatep2 - the second predicatePredicatejava.lang.NullPointerException - if p1 or p2 is nullpublic static <T> Predicate<T> and(@NotNull Predicate<? super T> p1, @NotNull Predicate<? super T> p2, @NotNull Predicate<? super T>... rest)
T - the type of the input to the functionp1 - the first predicatep2 - the second predicaterest - the rest predicatesPredicatejava.lang.NullPointerException - if any of predicates are nullpublic static <T> Predicate<T> or(@NotNull Predicate<? super T> p1, @NotNull Predicate<? super T> p2)
T - the type of the input to the functionp1 - the first predicatep2 - the second predicatePredicatejava.lang.NullPointerException - if p1 or p2 is nullpublic static <T> Predicate<T> or(@NotNull Predicate<? super T> p1, @NotNull Predicate<? super T> p2, @NotNull Predicate<? super T>... rest)
T - the type of the input to the functionp1 - the first predicatep2 - the second predicaterest - the rest predicatesPredicatejava.lang.NullPointerException - if any of predicates are nullpublic static <T> Predicate<T> xor(@NotNull Predicate<? super T> p1, @NotNull Predicate<? super T> p2)
T - the type of the input to the functionp1 - the first predicatep2 - the second predicatePredicatejava.lang.NullPointerException - if p1 or p2 is nullpublic static <T> Predicate<T> negate(@NotNull Predicate<? super T> predicate)
T - the type of the input to the functionpredicate - the predicate to be negatedPredicatejava.lang.NullPointerException - if p1 is nullpublic static <T> Predicate<T> notNull()
T - the type of the input to the functionPredicate that checks value to be not nullpublic static <T> Predicate<T> safe(@NotNull 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(@NotNull 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 resultIfFailedjava.lang.NullPointerException - if throwablePredicate is null