FailablePredicate¶
- @FunctionalInterface public abstract interface org.apache.commons.lang3.function.FailablePredicate<T, E extends Throwable>[source]¶
A functional interface like
Predicatethat declares aThrowable.- Parameters:
<T> – Predicate type.
<E> – The kind of thrown exception or error.
- Since:
3.11
Fields and constants¶
- @SuppressWarnings({"rawtypes"}) public static final FailablePredicate FALSE[source]¶
FALSE singleton
- @SuppressWarnings({"rawtypes"}) public static final FailablePredicate TRUE[source]¶
TRUE singleton
Methods¶
Returns a composed |
|
Gets the FALSE singleton. |
|
Returns a predicate that negates this predicate. |
|
Returns a composed |
|
Tests the predicate. |
|
Gets the TRUE singleton. |
- public default FailablePredicate<T, E> and(FailablePredicate<? super T, E> other)[source]¶
Returns a composed
FailablePredicatelikePredicate#and(Predicate).- Parameters:
other – A predicate that will be logically-ANDed with this predicate.
- Returns:
A composed
FailablePredicatelikePredicate#and(Predicate).- Throws:
java.lang.NullPointerException – Thrown if other is null.
- @SuppressWarnings({"unchecked"}) public static <T, E extends Throwable> FailablePredicate<T, E> falsePredicate()[source]¶
Gets the FALSE singleton.
- Type parameters:
<T> – Predicate type.
<E> – The kind of thrown exception or error.
- Returns:
The NOP singleton.
- public default FailablePredicate<T, E> negate()[source]¶
Returns a predicate that negates this predicate.
- Returns:
A predicate that negates this predicate.
- public default FailablePredicate<T, E> or(FailablePredicate<? super T, E> other)[source]¶
Returns a composed
FailablePredicatelikePredicate#and(Predicate).- Parameters:
other – A predicate that will be logically-ORed with this predicate.
- Returns:
A composed
FailablePredicatelikePredicate#and(Predicate).- Throws:
java.lang.NullPointerException – Thrown if other is null.
- public abstract boolean test(T object) throws E[source]¶
Tests the predicate.
- Parameters:
object – The object to test the predicate on
- Returns:
The predicate’s evaluation
- Throws:
E – Thrown if the predicate fails.
- @SuppressWarnings({"unchecked"}) public static <T, E extends Throwable> FailablePredicate<T, E> truePredicate()[source]¶
Gets the TRUE singleton.
- Type parameters:
<T> – Predicate type.
<E> – The kind of thrown exception or error.
- Returns:
The NOP singleton.