@FunctionalInterface public interface ThrowingDoublePredicate extends DoublePredicate
boolean-valued function) of one double-valued argument, possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default DoublePredicate |
fallbackTo(DoublePredicate fallback)
Returns a
DoublePredicate evaluating the given predicate on the argument if this predicate throws an exception. |
default DoublePredicate |
fallbackTo(DoublePredicate fallback,
Consumer<Exception> exceptionConsumer)
Returns a
DoublePredicate evaluating the given predicate on the argument if this predicate throws an exception. |
default DoublePredicate |
orReturn(boolean value)
Returns a
DoublePredicate returning the given value if this predicate throws an exception. |
default DoublePredicate |
orReturn(boolean value,
Consumer<Exception> exceptionConsumer)
Returns a
DoublePredicate returning the given value if this predicate throws an exception. |
default ThrowingDoublePredicate |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingDoublePredicate throwing an exception of the given type if this predicate throws an exception. |
default ThrowingDoublePredicate |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingDoublePredicate throwing an exception of the given type if this predicate throws an exception. |
default ThrowingDoublePredicate |
orTryWith(ThrowingDoublePredicate other)
Returns a
ThrowingDoublePredicate evaluating the given predicate on the argument if this predicate throws an exception. |
default ThrowingDoublePredicate |
orTryWith(ThrowingDoublePredicate other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingDoublePredicate evaluating the given predicate on the argument if this predicate throws an exception. |
default boolean |
test(double argument)
Evaluates this predicate on the given argument.
|
boolean |
testThrowing(double argument)
Evaluates this predicate on the given argument.
|
and, negate, ordefault boolean test(double argument)
UncheckedException.test in interface DoublePredicateboolean testThrowing(double argument)
throws Exception
Exceptiondefault DoublePredicate fallbackTo(DoublePredicate fallback)
DoublePredicate evaluating the given predicate on the argument if this predicate throws an exception.IllegalArgumentException - if fallback is nulldefault DoublePredicate fallbackTo(DoublePredicate fallback, Consumer<Exception> exceptionConsumer)
DoublePredicate evaluating the given predicate on the argument if this predicate throws an exception.IllegalArgumentException - if fallback is nulldefault DoublePredicate orReturn(boolean value)
DoublePredicate returning the given value if this predicate throws an exception.default DoublePredicate orReturn(boolean value, Consumer<Exception> exceptionConsumer)
DoublePredicate returning the given value if this predicate throws an exception.default ThrowingDoublePredicate orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingDoublePredicate 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 ThrowingDoublePredicate orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingDoublePredicate 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 ThrowingDoublePredicate orTryWith(ThrowingDoublePredicate other)
ThrowingDoublePredicate evaluating the given predicate on the argument if this predicate throws an exception.IllegalArgumentException - if other is nulldefault ThrowingDoublePredicate orTryWith(ThrowingDoublePredicate other, Consumer<Exception> exceptionConsumer)
ThrowingDoublePredicate evaluating the given predicate on the argument if this predicate throws an exception.IllegalArgumentException - if other is null