接口 ResourceConsumer

函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface ResourceConsumer
Resource Consumer
从以下版本开始:
4.0 2021/12/18 18:17
作者:
Harry Yang
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Performs this operation on the given argument.
    Returns a composed Consumer that performs, in sequence, this operation followed by the after operation.
  • 方法详细资料

    • accept

      void accept(Resource t) throws IOException
      Performs this operation on the given argument.
      参数:
      t - the input argument
      抛出:
      IOException
    • andThen

      default ResourceConsumer andThen(ResourceConsumer after)
      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.
      参数:
      after - the operation to perform after this operation
      返回:
      a composed Consumer that performs in sequence this operation followed by the after operation
      抛出:
      NullPointerException - if after is null