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