@FunctionalInterface public interface ThrowingBiPredicate<T,U> extends BiPredicate<T,U>
boolean-valued function) of two arguments, possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default BiPredicate<T,U> |
fallbackTo(BiPredicate<T,U> fallback)
Returns a
BiPredicate evaluating the given predicate on the arguments if this predicate throws an exception. |
default BiPredicate<T,U> |
fallbackTo(BiPredicate<T,U> fallback,
Consumer<Exception> exceptionConsumer)
Returns a
BiPredicate evaluating the given predicate on the arguments if this predicate throws an exception. |
default BiPredicate<T,U> |
orReturn(boolean value)
Returns a
BiPredicate returning the given value if this predicate throws an exception. |
default BiPredicate<T,U> |
orReturn(boolean value,
Consumer<Exception> exceptionConsumer)
Returns a
BiPredicate returning the given value if this predicate throws an exception. |
default ThrowingBiPredicate<T,U> |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingBiPredicate throwing an exception of the given type if this predicate throws an exception. |
default ThrowingBiPredicate<T,U> |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingBiPredicate throwing an exception of the given type if this predicate throws an exception. |
default ThrowingBiPredicate<T,U> |
orTryWith(ThrowingBiPredicate<? super T,? super U> other)
Returns a
ThrowingBiPredicate evaluating the given predicate on the arguments if this predicate throws an exception. |
default ThrowingBiPredicate<T,U> |
orTryWith(ThrowingBiPredicate<? super T,? super U> other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingBiPredicate evaluating the given predicate on the arguments if this predicate throws an exception. |
default boolean |
test(T former,
U latter)
Evaluates this predicate on the given arguments.
|
boolean |
testThrowing(T former,
U latter)
Evaluates this predicate on the given arguments.
|
and, negate, ordefault boolean test(T former, U latter)
UncheckedException.test in interface BiPredicate<T,U>boolean testThrowing(T former, U latter) throws Exception
Exceptiondefault BiPredicate<T,U> fallbackTo(BiPredicate<T,U> fallback)
BiPredicate evaluating the given predicate on the arguments if this predicate throws an exception.IllegalArgumentException - if fallback is nulldefault BiPredicate<T,U> fallbackTo(BiPredicate<T,U> fallback, Consumer<Exception> exceptionConsumer)
BiPredicate evaluating the given predicate on the arguments if this predicate throws an exception.IllegalArgumentException - if fallback is nulldefault BiPredicate<T,U> orReturn(boolean value)
BiPredicate returning the given value if this predicate throws an exception.default BiPredicate<T,U> orReturn(boolean value, Consumer<Exception> exceptionConsumer)
BiPredicate returning the given value if this predicate throws an exception.default ThrowingBiPredicate<T,U> orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingBiPredicate throwing an exception of the given type if this predicate throws an exception.
The original exception thrown by this predicate is the cause of the thrown exception.
The exception class must have a constructor accepting a single Throwable as an argument.
IllegalArgumentException - if exceptionClass is nulldefault ThrowingBiPredicate<T,U> orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingBiPredicate throwing an exception of the given type if this predicate throws an exception.
The original exception thrown by this predicate is the cause of the thrown exception.
The exception class must have a constructor accepting String and Throwable as arguments.
IllegalArgumentException - if exceptionClass is nulldefault ThrowingBiPredicate<T,U> orTryWith(ThrowingBiPredicate<? super T,? super U> other)
ThrowingBiPredicate evaluating the given predicate on the arguments if this predicate throws an exception.IllegalArgumentException - if other is nulldefault ThrowingBiPredicate<T,U> orTryWith(ThrowingBiPredicate<? super T,? super U> other, Consumer<Exception> exceptionConsumer)
ThrowingBiPredicate evaluating the given predicate on the arguments if this predicate throws an exception.IllegalArgumentException - if other is null