T
- some generic flagU
- some generic flagE
- The extension@FunctionalInterface public interface BiConsumerWithThrowable<T,U,E extends Throwable> extends BiConsumer<T,U>
Modifier and Type | Method and Description |
---|---|
static <T,U,E extends Throwable> |
aBiConsumerThatUnsafelyThrowsUnchecked(BiConsumerWithThrowable<T,U,E> biconsumerwiththrowable)
Utility method to unwrap lambdas of type BiConsumer and withUncheckedThrowable any Exception
|
default void |
accept(T v1,
U v2)
Overridden method of BiConsumerWithThrowable that will call acceptWithThrowable, but catching any exceptions.
|
void |
acceptWithThrowable(T v1,
U v2)
Functional method that will throw exceptions.
|
static <T,U,E extends Throwable> |
asBiConsumerWithThrowable(BiConsumer<T,U> biconsumer)
Utility method to convert BiConsumerWithThrowable
|
static <T,U,E extends Throwable> |
castBiConsumerWithThrowable(BiConsumerWithThrowable<T,U,E> biconsumerwiththrowable)
Utility method to mark lambdas of type BiConsumerWithThrowable
|
default BiConsumerWithThrowable<T,U,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default BiConsumerWithThrowable<T,U,E> |
onException(Consumer<Throwable> consumer) |
default BiConsumer<T,U> |
thatThrowsNothing() |
default BiConsumer<T,U> |
thatUnsafelyThrowsUnchecked() |
default BiConsumerWithThrowable<T,U,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default BiConsumerWithThrowable<T,U,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default BiConsumerWithThrowable<T,U,E> |
withLogging(org.slf4j.Logger logger,
String message) |
andThen
static <T,U,E extends Throwable> BiConsumerWithThrowable<T,U,E> castBiConsumerWithThrowable(BiConsumerWithThrowable<T,U,E> biconsumerwiththrowable)
T
- Generic that corresponds to the same generic on BiConsumerU
- Generic that corresponds to the same generic on BiConsumerE
- The type this interface is allowed to throwbiconsumerwiththrowable
- The interface instancestatic <T,U,E extends Throwable> BiConsumer<T,U> aBiConsumerThatUnsafelyThrowsUnchecked(BiConsumerWithThrowable<T,U,E> biconsumerwiththrowable) throws E extends Throwable
T
- Generic that corresponds to the same generic on BiConsumerU
- Generic that corresponds to the same generic on BiConsumerE
- The type this interface is allowed to throwbiconsumerwiththrowable
- The interface instanceE
- the original Exception from biconsumerwiththrowableE extends Throwable
static <T,U,E extends Throwable> BiConsumerWithThrowable<T,U,E> asBiConsumerWithThrowable(BiConsumer<T,U> biconsumer)
T
- Generic that corresponds to the same generic on BiConsumerU
- Generic that corresponds to the same generic on BiConsumerE
- The type this interface is allowed to throwbiconsumer
- The interface instancedefault void accept(T v1, U v2)
accept
in interface BiConsumer<T,U>
v1
- parameter to overridden methodv2
- parameter to overridden methodvoid acceptWithThrowable(T v1, U v2) throws E extends Throwable
default BiConsumer<T,U> thatThrowsNothing()
default BiConsumer<T,U> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default BiConsumerWithThrowable<T,U,E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault BiConsumerWithThrowable<T,U,E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault BiConsumerWithThrowable<T,U,E> withLogging()
default BiConsumerWithThrowable<T,U,E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default BiConsumerWithThrowable<T,U,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.