Enum IdentityFunction

java.lang.Object
java.lang.Enum<IdentityFunction>
org.wildfly.clustering.marshalling.spi.IdentityFunction
All Implemented Interfaces:
Serializable, Comparable<IdentityFunction>, Function<Object,Object>

public enum IdentityFunction extends Enum<IdentityFunction> implements Function<Object,Object>
Behaves the same as Function.identity(), where the return type is a superclass of the function parameter.
Author:
Paul Ferraro
  • Enum Constant Details

  • Method Details

    • values

      public static IdentityFunction[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static IdentityFunction valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public Object apply(Object value)
      Specified by:
      apply in interface Function<Object,Object>
    • getInstance

      public static <T extends R, R> Function<T,R> getInstance()
      Returns a function that returns its parameter.
      Type Parameters:
      T - the parameter type
      R - the return type
      Returns:
      a function that return its parameter