Consumer<T>

Description

Represents an operation that will accept an input and returns nothing. For this to be useful, it will have to cause side effects.

Abstract method

accept

default method(s)

andThen

Popular usage

As a parameter to the forEach method

Primitive specializations

IntConsumer, LongConsumer, DoubleConsumer, …

Get Functional Programming in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.