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