java.util.function.BiConsumer<T,U>@FunctionalInterface
public interface ThrowingBiConsumer<T,U>
extends java.util.function.BiConsumer<T,U>
| Modifier and Type | Method | Description |
|---|---|---|
default void |
accept(T former,
U latter) |
Performs this operation on the given arguments.
|
void |
acceptThrowing(T former,
U latter) |
Performs this operation on the given arguments.
|
default java.util.function.BiConsumer<T,U> |
fallbackTo(java.util.function.BiConsumer<T,U> fallback) |
Returns a
BiConsumer performing the given operation on the arguments if this operation throws an exception. |
default java.util.function.BiConsumer<T,U> |
fallbackTo(java.util.function.BiConsumer<T,U> fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
BiConsumer performing the given operation on the arguments if this operation throws an exception. |
default ThrowingBiConsumer<T,U> |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass) |
Returns a
ThrowingBiConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingBiConsumer<T,U> |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass,
java.lang.String message) |
Returns a
ThrowingBiConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingBiConsumer<T,U> |
orTryWith(ThrowingBiConsumer<? super T,? super U> other) |
Returns a
ThrowingBiConsumer performing the given operation on the arguments if this operation throws an exception. |
default ThrowingBiConsumer<T,U> |
orTryWith(ThrowingBiConsumer<? super T,? super U> other,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
ThrowingBiConsumer performing the given operation on the arguments if this operation throws an exception. |
default void accept(T former, U latter)
UncheckedException.void acceptThrowing(T former, U latter) throws java.lang.Exception
java.lang.Exceptiondefault java.util.function.BiConsumer<T,U> fallbackTo(java.util.function.BiConsumer<T,U> fallback)
BiConsumer performing the given operation on the arguments if this operation throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault java.util.function.BiConsumer<T,U> fallbackTo(java.util.function.BiConsumer<T,U> fallback, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
BiConsumer performing the given operation on the arguments if this operation throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault ThrowingBiConsumer<T,U> orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
ThrowingBiConsumer throwing an exception of the given type if this operation throws an exception.
The original exception thrown by this operation 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 ThrowingBiConsumer<T,U> orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass, java.lang.String message)
ThrowingBiConsumer throwing an exception of the given type if this operation throws an exception.
The original exception thrown by this operation 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 ThrowingBiConsumer<T,U> orTryWith(ThrowingBiConsumer<? super T,? super U> other)
ThrowingBiConsumer performing the given operation on the arguments if this operation throws an exception.java.lang.IllegalArgumentException - if other is nulldefault ThrowingBiConsumer<T,U> orTryWith(ThrowingBiConsumer<? super T,? super U> other, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
ThrowingBiConsumer performing the given operation on the arguments if this operation throws an exception.java.lang.IllegalArgumentException - if other is null