# Consumer

public interface **Consumer**

|---|---|---|
| Known Indirect Subclasses [Stream.Builder](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/stream/Stream.Builder.html)\<T\> |---|---| | [Stream.Builder](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/stream/Stream.Builder.html)\<T\> | A mutable builder for a `Stream`. | |||

Represents an operation that accepts a single input argument and returns no
result. Unlike most other functional interfaces, `Consumer` is expected
to operate via side-effects.

This is a [functional interface](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/package-summary)
whose functional method is `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html#accept(T)`.

### Public Method Summary

|---|---|
| abstract void | [accept](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html#accept(T))(T t) Performs this operation on the given argument. |
| [Consumer](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html)\<T\> | [andThen](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html#andThen(java.util.function.Consumer<?%20super%20T>))([Consumer](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html)\<? super T\> after) Returns a composed `Consumer` that performs, in sequence, this operation followed by the `after` operation. |

## Public Methods

#### public abstract void
**accept**
(T t)

Performs this operation on the given argument.

##### Parameters

| t | the input argument |
|---|---|

#### public [Consumer](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html)\<T\>
**andThen**
([Consumer](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Consumer.html)\<? super T\> after)

Returns a composed `Consumer` that performs, in sequence, this
operation followed by the `after` 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,
the `after` operation will not be performed.

##### Parameters

| after | the operation to perform after this operation |
|---|---|

##### Returns

- a composed `Consumer` that performs in sequence this operation followed by the `after` operation

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `after` is null |
|---|---|