T - The input type@FunctionalInterface
public interface ThrowingConsumer<T>
| Modifier and Type | Method and Description |
|---|---|
void |
accept(T t)
Accept the input.
|
default java.util.function.Consumer<T> |
toConsumer()
Convert this ThrowingConsumer to a standard Consumer.
|
static <T> java.util.function.Consumer<T> |
toConsumer(ThrowingConsumer<T> consumer)
Convert a ThrowingConsumer to a standard Consumer.
|
default void |
tryAccept(T t)
Accept the input and sneakily throw any exceptions.
|
static <T> java.util.function.Consumer<T> toConsumer(ThrowingConsumer<T> consumer)
T - The input typeconsumer - The ThrowingConsumervoid accept(T t) throws java.lang.Throwable
t - The inputjava.lang.Throwable - If an error occursdefault void tryAccept(T t)
t - The inputdefault java.util.function.Consumer<T> toConsumer()