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