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