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