Interface Consumer<T>
This is a functional interface whose functional method is accept(Object).
-
Method Summary
All MethodsInstance MethodsAbstract MethodsDefault Methods
-
Method Details
-
accept
Performs this operation on the given argument.Parameters: t - the input argument -
andThen
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 - if after is null
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.