| 限定符和类型 | 方法和说明 |
|---|---|
static <E extends Enum<E> & EnumValue<E,V>,V> |
compare(E left,
E right)
提供实例值比较。
|
Class<E> |
getDeclaringClass() |
static <E extends Enum<E> & EnumValue<E,V>,V> |
toString(E e) |
static <E extends Enum<E> & EnumValue<E,V>,V> |
valueOf(Class<E> enumType,
V value)
Returns the enum constant of the specified enum type with the
specified value.
|
Class<E> getDeclaringClass()
Enum.getDeclaringClass()static <E extends Enum<E> & EnumValue<E,V>,V> E valueOf(Class<E> enumType, V value)
E - The enum type whose constant is to be returnedenumType - the Class object of the enum type from which
to return a constantvalue - the value of the constant to returnIllegalArgumentException - if the specified enum type has
no constant with the specified value, or the specified
class object does not represent an enum typeNullPointerException - if enumType or name
is nullstatic <E extends Enum<E> & EnumValue<E,V>,V> int compare(E left, E right)
Comparable 接口,则比较使用实例值比较,否则使用枚举名称比较 Enum.compareTo(Enum)E - 枚举类型V - 枚举值类型left - leftright - rightComparable.compareTo(Object)Copyright © 2021. All rights reserved.