E
- the type of the enum constantConstantDesc
public static final class Enum.EnumDesc<E extends Enum<E>> extends DynamicConstantDesc<E>
enum
constant.Modifier and Type | Method | Description |
---|---|---|
static <E extends Enum<E>> |
of(ClassDesc enumClass,
String constantName) |
Return a nominal descriptor for the specified
enum class and name |
E |
resolveConstantDesc(MethodHandles.Lookup lookup) |
Resolve this descriptor reflectively, emulating the resolution behavior
of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4.
|
String |
toString() |
Returns a string representation of the object.
|
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed
public static <E extends Enum<E>> Enum.EnumDesc<E> of(ClassDesc enumClass, String constantName)
enum
class and nameE
- the type of the enum constantenumClass
- a ClassDesc
describing the enum
classconstantName
- the unqualified name of the enum constantNullPointerException
- if any argument is nullpublic E resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException
ConstantDesc
MethodHandles.Lookup
parameter. No caching of the resulting value is performed.resolveConstantDesc
in interface ConstantDesc
resolveConstantDesc
in class DynamicConstantDesc<E extends Enum<E>>
lookup
- The MethodHandles.Lookup
to provide name resolution
and access control contextReflectiveOperationException
- if a class, method, or field
could not be reflectively resolved in the course of resolutionpublic String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class DynamicConstantDesc<E extends Enum<E>>