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