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