A
- the type of the first argument of the consumer@ConsumerType
@FunctionalInterface
public interface ThrowableConsumer<A>
Consumer
that can throw an exception.
This interface can be implemented with a lambda function.
Modifier and Type | Method and Description |
---|---|
void |
accept(A a)
Operates with one parameter and returns
void . |
default ThrowableConsumer<A> |
andThen(ThrowableConsumer<? super A> after)
Returns the
ThrowableConsumer function that first executes the
current ThrowableConsumer instance's accept method, then
executes the after parameter's accept method. |
static <A> ThrowableConsumer<A> |
empty()
Returns an empty
ThrowableConsumer that doesn't perform any
operation. |
static <A> ThrowableConsumer<A> empty()
ThrowableConsumer
that doesn't perform any
operation.ThrowableConsumer
that doesn't perform any
operationvoid accept(A a) throws java.lang.Exception
void
. This function can
be implemented explicitly or with a lambda.a
- the first function argumentjava.lang.Exception
default ThrowableConsumer<A> andThen(ThrowableConsumer<? super A> after)
ThrowableConsumer
function that first executes the
current ThrowableConsumer
instance's accept
method, then
executes the after
parameter's accept
method.after
- the ThrowableConsumer
instance to execute after the
current instanceThrowableConsumer
that executes the current
instance's accept
method, as well as that of after