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