接口 Function<T,R>

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

@FunctionalInterface public interface Function<T,R>
  • 方法详细资料

    • apply

      R apply(T t)
      申请
      参数:
      t - 类型
      返回:
      返回指定类型
    • compose

      default <V> Function<V,R> compose(Function<? super V,? extends T> before)
      组成
      类型参数:
      V - 值类型
      参数:
      before - 之前
      返回:
      一种组合函数,首先应用before函数,然后应用此函数
    • andThen

      default <V> Function<T,V> andThen(Function<? super R,? extends V> after)
      或者
      类型参数:
      V - 值类型
      参数:
      after - 开始值
      返回:
      返回一个组合函数,该函数首先应用此函数,然后应用after函数