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