程序包 cn.linjpxc.enumx

接口 EnumValue<E extends Enum<E>,V>

类型参数:
E - 枚举类型
V - 枚举值类型
所有超级接口:
Serializable, Valuable<V>

public interface EnumValue<E extends Enum<E>,V> extends Valuable<V>
统一枚举值接口。
作者:
linjpxc
  • 方法详细资料

    • getDeclaringClass

      Class<E> getDeclaringClass()
      另请参阅:
    • valueOf

      static <E extends Enum<E> & EnumValue<E, V>, V> E valueOf(Class<E> enumType, V value)
      Returns the enum constant of the specified enum type with the specified value.
      类型参数:
      E - The enum type whose constant is to be returned
      参数:
      enumType - the Class object of the enum type from which to return a constant
      value - the value of the constant to return
      返回:
      the enum constant of the specified enum type with the specified value
      抛出:
      IllegalArgumentException - if the specified enum type has no constant with the specified value, or the specified class object does not represent an enum type
      NullPointerException - if enumType or name is null
    • toString

      static <E extends Enum<E> & EnumValue<E, V>, V> String toString(E e)
    • compare

      static <E extends Enum<E> & EnumValue<E, V>, V> int compare(E left, E right)
      提供实例值比较。若实例的值实现 Comparable 接口,则比较使用实例值比较,否则使用枚举名称比较 Enum.compareTo(Enum)
      类型参数:
      E - 枚举类型
      V - 枚举值类型
      参数:
      left - left
      right - right
      返回:
      Comparable.compareTo(Object)