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