T - the type of the input to the operation@FunctionalInterfacepublic interfaceConsumer<T>
Consumer is expected to operate via side-effects.This is afunctional interface whose functional method isaccept(Object).
| Modifier and Type | Method | Description |
|---|---|---|
void | accept(T t) | Performs this operation on the given argument. |
defaultConsumer<T> | andThen(Consumer<? superT> after) | Returns a composed Consumer that performs, in sequence, this operation followed by theafter operation. |
void accept(T t)
t - the input argumentdefault Consumer<T> andThen(Consumer<? superT> after)
Consumer that performs, in sequence, this operation followed by theafter operation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, theafter operation will not be performed.after - the operation to perform after this operationConsumer that performs in sequence this operation followed by theafter operationNullPointerException - ifafter is null