T
- type of the consumed elements.E
- type of the exception thrown.@Public @FunctionalInterface public interface ThrowingConsumer<T,E extends Throwable>
Consumer
interface enhanced with
the ability to throw an exception.Modifier and Type | Method and Description |
---|---|
void |
accept(T t)
Performs this operation on the given argument.
|
static <A> Consumer<A> |
unchecked(ThrowingConsumer<A,?> throwingConsumer)
Convert a
ThrowingConsumer into a Consumer . |
static <A> Consumer<A> unchecked(ThrowingConsumer<A,?> throwingConsumer)
ThrowingConsumer
into a Consumer
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.