@FunctionalInterface public interface ThrowingLongUnaryOperator extends LongUnaryOperator
long-valued operand that produces a long-valued result, possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default ThrowingLongUnaryOperator |
andThen(ThrowingLongUnaryOperator after)
Returns a composed
ThrowingLongUnaryOperator that first applies this operator to the argument, and then applies the after operator to the result. |
default long |
applyAsLong(long argument)
Applies this operator to the given argument.
|
long |
applyAsLongThrowing(long argument)
Applies this operator to the given argument.
|
default ThrowingLongUnaryOperator |
compose(ThrowingLongUnaryOperator before)
Returns a composed
ThrowingLongUnaryOperator that first applies the before operator to the argument, and then applies this operator to the result. |
default LongUnaryOperator |
fallbackTo(LongUnaryOperator fallback)
Returns a
LongUnaryOperator applying the given operator to the argument if this operator throws an exception. |
default LongUnaryOperator |
fallbackTo(LongUnaryOperator fallback,
Consumer<Exception> exceptionConsumer)
Returns a
LongUnaryOperator applying the given operator to the argument if this operator throws an exception. |
default LongUnaryOperator |
orReturn(long value)
Returns a
LongUnaryOperator returning the given value if this operator throws an exception. |
default LongUnaryOperator |
orReturn(long value,
Consumer<Exception> exceptionConsumer)
Returns a
LongUnaryOperator returning the given value if this operator throws an exception. |
default ThrowingLongUnaryOperator |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingLongUnaryOperator throwing an exception of the given type if this operator throws an exception. |
default ThrowingLongUnaryOperator |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingLongUnaryOperator throwing an exception of the given type if this operator throws an exception. |
default ThrowingLongUnaryOperator |
orTryWith(ThrowingLongUnaryOperator other)
Returns a
ThrowingLongUnaryOperator applying the given operator to the argument if this operator throws an exception. |
default ThrowingLongUnaryOperator |
orTryWith(ThrowingLongUnaryOperator other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingLongUnaryOperator applying the given operator to the argument if this operator throws an exception. |
andThen, compose, identitydefault ThrowingLongUnaryOperator andThen(ThrowingLongUnaryOperator after)
ThrowingLongUnaryOperator that first applies this operator to the argument, and then applies the after operator to the result.IllegalArgumentException - if after is nulldefault long applyAsLong(long argument)
UncheckedException.applyAsLong in interface LongUnaryOperatorlong applyAsLongThrowing(long argument)
throws Exception
Exceptiondefault ThrowingLongUnaryOperator compose(ThrowingLongUnaryOperator before)
ThrowingLongUnaryOperator that first applies the before operator to the argument, and then applies this operator to the result.IllegalArgumentException - if before is nulldefault LongUnaryOperator fallbackTo(LongUnaryOperator fallback)
LongUnaryOperator applying the given operator to the argument if this operator throws an exception.IllegalArgumentException - if fallback is nulldefault LongUnaryOperator fallbackTo(LongUnaryOperator fallback, Consumer<Exception> exceptionConsumer)
LongUnaryOperator applying the given operator to the argument if this operator throws an exception.IllegalArgumentException - if fallback is nulldefault LongUnaryOperator orReturn(long value)
LongUnaryOperator returning the given value if this operator throws an exception.default LongUnaryOperator orReturn(long value, Consumer<Exception> exceptionConsumer)
LongUnaryOperator returning the given value if this operator throws an exception.default ThrowingLongUnaryOperator orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingLongUnaryOperator 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 ThrowingLongUnaryOperator orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingLongUnaryOperator 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 ThrowingLongUnaryOperator orTryWith(ThrowingLongUnaryOperator other)
ThrowingLongUnaryOperator applying the given operator to the argument if this operator throws an exception.IllegalArgumentException - if other is nulldefault ThrowingLongUnaryOperator orTryWith(ThrowingLongUnaryOperator other, Consumer<Exception> exceptionConsumer)
ThrowingLongUnaryOperator applying the given operator to the argument if this operator throws an exception.IllegalArgumentException - if other is null