接口 Enumerable<V>

所有超级接口:
Descriptive

public interface Enumerable<V> extends Descriptive
Enumerable for Enum
从以下版本开始:
4.0
作者:
Harry Yang
  • 方法概要

    修饰符和类型
    方法
    说明
    static <T extends Enumerable<V>, V>
    Optional<T>
    find(Class<T> enumerable, V value)
     
    default String
    Return a description
    default V
     
    static <T extends Enumerable<V>, V>
    V
    getValue(Class<T> enumerable, String name)
    Get the value corresponding to the name
    The default name of the enumeration, this method does not need to be implemented, the enumeration class is automatically inherited
    static <T extends Enumerable<V>, V>
    T
    of(Class<T> enumerable, V value)
    Returns Enumerable by enum value
    static <T extends Enumerable<V>, V>
    T
    of(Class<T> enumerable, V value, Supplier<T> defaultValue)
     
    static <T extends Enumerable<V>, V>
    T
    of(Class<T> enumerable, V value, T defaultValue)
     
  • 方法详细资料

    • getValue

      default V getValue()
    • getDescription

      default String getDescription()
      从接口复制的说明: Descriptive
      Return a description
      指定者:
      getDescription 在接口中 Descriptive
    • name

      String name()
      The default name of the enumeration, this method does not need to be implemented, the enumeration class is automatically inherited
    • of

      @Nullable static <T extends Enumerable<V>, V> T of(Class<T> enumerable, @Nullable V value)
      Returns Enumerable by enum value
      类型参数:
      T - enumeration type
      V - enumeration value type
      参数:
      enumerable - enum
      value - enumeration value
      返回:
      enumeration instance
      抛出:
      NullPointerException - if enumerable is null
      另请参阅:
    • getValue

      @Nullable static <T extends Enumerable<V>, V> V getValue(Class<T> enumerable, String name)
      Get the value corresponding to the name
      类型参数:
      T - enum type
      V - enumeration value type
      参数:
      enumerable - enumeration class
      name - enumeration name
      返回:
      enumeration value
      另请参阅:
    • of

      static <T extends Enumerable<V>, V> T of(Class<T> enumerable, V value, Supplier<T> defaultValue)
      类型参数:
      T - enum type
      V - enumeration value type
      参数:
      defaultValue - default value
      另请参阅:
    • of

      static <T extends Enumerable<V>, V> T of(Class<T> enumerable, V value, T defaultValue)
      类型参数:
      T - enum type
      V - enumeration value type
      参数:
      defaultValue - default value
      另请参阅:
    • find

      static <T extends Enumerable<V>, V> Optional<T> find(Class<T> enumerable, V value)
      返回:
      Optional of T