Interface FailablePredicate<T,E extends Throwable>
- Type Parameters:
T
- Predicate type.E
- The kind of thrown exception or error.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
- Since:
- 3.11
-
Field Summary
Modifier and TypeFieldDescriptionstatic final FailablePredicate
FALSE singletonstatic final FailablePredicate
TRUE singleton -
Method Summary
Modifier and TypeMethodDescriptiondefault FailablePredicate<T,
E> and
(FailablePredicate<? super T, E> other) Returns a composedFailablePredicate
likePredicate.and(Predicate)
.static <T,
E extends Throwable>
FailablePredicate<T,E> Returns The FALSE singleton.default FailablePredicate<T,
E> negate()
Returns a predicate that negates this predicate.default FailablePredicate<T,
E> or
(FailablePredicate<? super T, E> other) Returns a composedFailablePredicate
likePredicate.and(Predicate)
.boolean
Tests the predicate.static <T,
E extends Throwable>
FailablePredicate<T,E> Returns The TRUE singleton.
-
Field Details
-
FALSE
FALSE singleton -
TRUE
TRUE singleton
-
-
Method Details
-
falsePredicate
Returns The FALSE singleton.- Type Parameters:
T
- Predicate type.E
- The kind of thrown exception or error.- Returns:
- The NOP singleton.
-
truePredicate
Returns The TRUE singleton.- Type Parameters:
T
- Predicate type.E
- The kind of thrown exception or error.- Returns:
- The NOP singleton.
-
and
Returns a composedFailablePredicate
likePredicate.and(Predicate)
.- Parameters:
other
- a predicate that will be logically-ANDed with this predicate.- Returns:
- a composed
FailablePredicate
likePredicate.and(Predicate)
. - Throws:
NullPointerException
- if other is null
-
negate
Returns a predicate that negates this predicate.- Returns:
- a predicate that negates this predicate.
-
or
Returns a composedFailablePredicate
likePredicate.and(Predicate)
.- Parameters:
other
- a predicate that will be logically-ORed with this predicate.- Returns:
- a composed
FailablePredicate
likePredicate.and(Predicate)
. - Throws:
NullPointerException
- if other is null
-
test
Tests the predicate.- Parameters:
object
- the object to test the predicate on- Returns:
- the predicate's evaluation
- Throws:
E
- if the predicate fails
-