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