Interface FunctionX<T,R>

Type Parameters:
T - 参数类型
R - 返回值类型
All Superinterfaces:
Function<T,R>, Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface FunctionX<T,R> extends Function<T,R>, Serializable
可序列化的Function
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default R
    apply(T t)
    Applies this function to the given argument.
    Applies this function to the given argument.
    static <T, R> Function<T,R>
    casting identity
    static <T> FunctionX<T,T>
    Returns a function that always returns its input argument.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • identity

      static <T> FunctionX<T,T> identity()
      Returns a function that always returns its input argument.
      Type Parameters:
      T - the type of the input and output objects to the function
      Returns:
      a function that always returns its input argument
    • castingIdentity

      static <T, R> Function<T,R> castingIdentity()
      casting identity
      Type Parameters:
      T - param type
      R - result type
      Returns:
      identity after casting
    • applying

      R applying(T t) throws Throwable
      Applies this function to the given argument.
      Parameters:
      t - the function argument
      Returns:
      the function result
      Throws:
      Exception - wrapped checked exception
      Throwable
    • apply

      default R apply(T t)
      Applies this function to the given argument.
      Specified by:
      apply in interface Function<T,R>
      Parameters:
      t - the function argument
      Returns:
      the function result