T
- The type of input objects to accept
@FunctionalInterface public interface Consumer<T>
Consumer
is expected to
operate via side-effects.Modifier and Type | Method and Description |
---|---|
void |
accept(T t)
Accept an input value.
|
default Consumer<T> |
chain(Consumer<? super T> other)
Returns a
Consumer which performs, in sequence, the operation
represented by this object followed by the operation represented by
the other Consumer . |
void accept(T t)
t
- the input objectdefault Consumer<T> chain(Consumer<? super T> other)
Consumer
which performs, in sequence, the operation
represented by this object followed by the operation represented by
the other Consumer
.
Any exceptions thrown by either accept
method are relayed
to the caller; if performing this operation throws an exception, the
other operation will not be performed.
other
- a Consumer which will be chained after this Consumeraccept
method
of this Consumer and the accept
method of the specified Consumer
operationNullPointerException
- if other is null Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.
DRAFT internal-0