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