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