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