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
- Enclosing class:
Enum<E extends Enum<E>>
public static final class Enum.EnumDesc<E extends Enum<E>> extends DynamicConstantDesc<E>
A nominal descriptor for an
enum constant.- Since:
- 12
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
static <E extends Enum<E>> |
of |
Returns a nominal descriptor for the specified enum class and name |
Methods declared in class DynamicConstantDesc
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed, resolveConstantDesc, toString | Modifier and Type | Method | Description |
|---|---|---|
ConstantDesc[] |
bootstrapArgs() |
Returns the bootstrap arguments for this constant. |
List |
bootstrapArgsList() |
Returns the bootstrap arguments for this constant as an immutable List. |
DirectMethodHandleDesc |
bootstrapMethod() |
Returns a MethodHandleDesc describing the bootstrap method for this constant. |
String |
constantName() |
Returns the name that would appear in the NameAndType operand of the LDC for this constant. |
ClassDesc |
constantType() |
Returns a ClassDesc describing the type that would appear in the NameAndType operand of the LDC for this constant. |
final boolean |
equals |
Compares the specified object with this descriptor for equality. |
final int |
hashCode() |
Returns a hash code value for this object. |
static <T> DynamicConstantDesc |
of |
Returns a nominal descriptor for a dynamic constant whose bootstrap has no static arguments, whose name parameter is ConstantDescs.DEFAULT_NAME, and whose type parameter is always the same as the bootstrap method return type. |
static <T> DynamicConstantDesc |
of |
Returns a nominal descriptor for a dynamic constant whose name parameter is ConstantDescs.DEFAULT_NAME, and whose type parameter is always the same as the bootstrap method return type. |
static <T> ConstantDesc |
ofCanonical |
Returns a nominal descriptor for a dynamic constant, transforming it into a more specific type if the constant bootstrap is a well-known one and a more specific nominal descriptor type (e.g., ClassDesc) is available. |
static <T> DynamicConstantDesc |
ofNamed |
Returns a nominal descriptor for a dynamic constant. |
E |
resolveConstantDesc |
|
String |
toString() |
Returns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments. |
Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Method Details
of
public static <E extends Enum<E>> Enum.EnumDesc<E> of(ClassDesc enumClass, String constantName)
Returns a nominal descriptor for the specified
enum class and name- Type Parameters:
E- the type of the enum constant- Parameters:
-
enumClass- aClassDescdescribing theenumclass -
constantName- 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
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.