接口 ResourceConsumer
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Resource Consumer
- 从以下版本开始:
- 4.0 2021/12/18 18:17
- 作者:
- Harry Yang
-
方法概要
修饰符和类型方法说明voidPerforms this operation on the given argument.default ResourceConsumerandThen(ResourceConsumer after) Returns a composedConsumerthat performs, in sequence, this operation followed by theafteroperation.
-
方法详细资料
-
accept
Performs this operation on the given argument.- 参数:
t- the input argument- 抛出:
IOException
-
andThen
Returns a composedConsumerthat performs, in sequence, this operation followed by theafteroperation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, theafteroperation will not be performed.- 参数:
after- the operation to perform after this operation- 返回:
- a composed
Consumerthat performs in sequence this operation followed by theafteroperation - 抛出:
NullPointerException- ifafteris null
-