T
- 操作输入的类型
@FunctionalInterface public interface Consumer<T>
Consumer
预计将通过副作用进行操作。
这是一个functional interface的功能方法是accept(Object)
。
void accept(T t)
t
- 输入参数
default Consumer<T> andThen(Consumer<? super T> after)
Consumer
, Consumer
执行该操作,后跟after
操作。
如果执行任一操作会抛出异常,它将被转发到组合操作的调用者。
如果执行此操作抛出一个异常, after
操作将不被执行。
after
- 此操作后执行的操作
Consumer
按顺序执行该操作,后跟
after
操作
NullPointerException
- if
after
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, 2014, Oracle and/or its affiliates. All rights reserved.