Package org.qiunet.utils.fakeenum
Class FakeEnum<E extends FakeEnum<E>>
java.lang.Object
org.qiunet.utils.fakeenum.FakeEnum<E>
- All Implemented Interfaces:
Serializable,Comparable<E>
public abstract class FakeEnum<E extends FakeEnum<E>>
extends Object
implements Comparable<E>, Serializable
假枚举需要继承的基类
会继承该类 并在有
FakeEnumClass的类使用
按照字段名注入name()- Author:
- qiunet 2022/1/3 08:38
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Objectclone()intbooleanReturns the Class object corresponding to this enum constant's enum type.inthashCode()final Stringname()final intordinal()toString()static <T extends FakeEnum<T>>
Tstatic <T extends FakeEnum<T>>
T根据指定的enum type 和name 返回对应的枚举值values()自己的valuesReturn all enum constants by type
-
Constructor Details
-
FakeEnum
public FakeEnum()
-
-
Method Details
-
name
-
ordinal
public final int ordinal() -
equals
-
hashCode
public int hashCode() -
toString
-
valueOf
-
valueOf
根据指定的enum type 和name 返回对应的枚举值- Type Parameters:
T-- Parameters:
enumType- 枚举的 classNamename-- Returns:
-
values
Return all enum constants by type- Type Parameters:
T-- Parameters:
enumType- type- Returns:
-
values
自己的values- Returns:
-
getDeclaringClass
Returns the Class object corresponding to this enum constant's enum type. Two enum constants e1 and e2 are of the same enum type if and only if e1.getDeclaringClass() == e2.getDeclaringClass(). (The value returned by this method may differ from the one returned by theObject.getClass()method for enum constants with constant-specific class bodies.)- Returns:
- the Class object corresponding to this enum constant's enum type
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
compareTo
- Specified by:
compareToin interfaceComparable<E extends FakeEnum<E>>
-