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 specifiedenumclass 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 DynamicConstantDesc
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed
-
Method Details
-
of
Returns a nominal descriptor for the specifiedenumclass and name- Type Parameters:
E- the type of the enum constant- Parameters:
enumClass- aClassDescdescribing theenumclassconstantName- 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:ConstantDescResolves 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.Lookupparameter. No caching of the resulting value is performed.- Specified by:
resolveConstantDescin interfaceConstantDesc- Overrides:
resolveConstantDescin classDynamicConstantDesc<E extends Enum<E>>- Parameters:
lookup- TheMethodHandles.Lookupto 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:DynamicConstantDescReturns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments.- Overrides:
toStringin classDynamicConstantDesc<E extends Enum<E>>- Returns:
- A compact textual description of this call site descriptor
-