@FunctionalInterface public interface ThrowingIntBinaryOperator extends IntBinaryOperator
int-valued operands, producing an int-valued result, and possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default int |
applyAsInt(int former,
int latter)
Applies this operator to the given argument.
|
int |
applyAsIntThrowing(int former,
int latter)
Applies this operator to the given argument.
|
default IntBinaryOperator |
fallbackTo(IntBinaryOperator fallback)
Returns an
IntBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default IntBinaryOperator |
fallbackTo(IntBinaryOperator fallback,
Consumer<Exception> exceptionConsumer)
Returns an
IntBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default IntBinaryOperator |
orReturn(int value)
Returns an
IntBinaryOperator returning the given value if this operator throws an exception. |
default IntBinaryOperator |
orReturn(int value,
Consumer<Exception> exceptionConsumer)
Returns an
IntBinaryOperator returning the given value if this operator throws an exception. |
default ThrowingIntBinaryOperator |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingIntBinaryOperator throwing an exception of the given type if this operator throws an exception. |
default ThrowingIntBinaryOperator |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingIntBinaryOperator throwing an exception of the given type if this operator throws an exception. |
default ThrowingIntBinaryOperator |
orTryWith(ThrowingIntBinaryOperator other)
Returns a
ThrowingIntBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default ThrowingIntBinaryOperator |
orTryWith(ThrowingIntBinaryOperator other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingIntBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default int applyAsInt(int former,
int latter)
UncheckedException.applyAsInt in interface IntBinaryOperatorint applyAsIntThrowing(int former,
int latter)
throws Exception
Exceptiondefault IntBinaryOperator fallbackTo(IntBinaryOperator fallback)
IntBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if fallback is nulldefault IntBinaryOperator fallbackTo(IntBinaryOperator fallback, Consumer<Exception> exceptionConsumer)
IntBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if fallback is nulldefault IntBinaryOperator orReturn(int value)
IntBinaryOperator returning the given value if this operator throws an exception.default IntBinaryOperator orReturn(int value, Consumer<Exception> exceptionConsumer)
IntBinaryOperator returning the given value if this operator throws an exception.default ThrowingIntBinaryOperator orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingIntBinaryOperator throwing an exception of the given type if this operator throws an exception.
The original exception thrown by this operator 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 ThrowingIntBinaryOperator orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingIntBinaryOperator throwing an exception of the given type if this operator throws an exception.
The original exception thrown by this operator 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 ThrowingIntBinaryOperator orTryWith(ThrowingIntBinaryOperator other)
ThrowingIntBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if other is nulldefault ThrowingIntBinaryOperator orTryWith(ThrowingIntBinaryOperator other, Consumer<Exception> exceptionConsumer)
ThrowingIntBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if other is null