Class Enum.EnumDesc<E extends Enum<E>>
java.lang.Object
java.lang.constant.DynamicConstantDesc<E>
java.lang.Enum.EnumDesc<E>
- Type Parameters:
E
- the type of the enum constant
- All Implemented Interfaces:
ConstantDesc
A nominal descriptor for an
enum
constant.- Since:
- 12
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<E>>
Enum.EnumDesc<E> Returns a nominal descriptor for the specifiedenum
class and nametoString()
Returns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments.Methods inherited from class java.lang.constant.DynamicConstantDesc
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed
-
Method Details
-
of
Returns a nominal descriptor for the specifiedenum
class and name- Type Parameters:
E
- the type of the enum constant- Parameters:
enumClass
- aClassDesc
describing theenum
classconstantName
- the unqualified name of the enum constant- Returns:
- the nominal descriptor
- Throws:
NullPointerException
- if any argument is null- See Java Virtual Machine Specification:
-
4.2.2 Unqualified Names
- Since:
- 12
-
resolveConstantDesc
Description copied from interface:ConstantDesc
Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution and access control context is provided by theMethodHandles.Lookup
parameter. No caching of the resulting value is performed.- Specified by:
resolveConstantDesc
in interfaceConstantDesc
- Overrides:
resolveConstantDesc
in classDynamicConstantDesc<E extends Enum<E>>
- Parameters:
lookup
- TheMethodHandles.Lookup
to provide name resolution and access control context- Returns:
- the resolved constant value
- Throws:
ReflectiveOperationException
- if a class, method, or field could not be reflectively resolved in the course of resolution
-
toString
Description copied from class:DynamicConstantDesc
Returns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments.- Overrides:
toString
in classDynamicConstantDesc<E extends Enum<E>>
- Returns:
- A compact textual description of this call site descriptor
-