Package Summary  Overview Summary

class:Enum.EnumDesc [NONE]

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:of(java.lang.constant.ClassDesc,java.lang.String) [NONE]

  • 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 - a ClassDesc describing the enum class
    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
  • method:resolveConstantDesc(java.lang.invoke.MethodHandles.Lookup) [NONE]

    resolveConstantDesc

    public E resolveConstantDesc (MethodHandles.Lookup lookup) throws ReflectiveOperationException
    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 the MethodHandles.Lookup parameter. No caching of the resulting value is performed.
    Specified by:
    resolveConstantDesc in interface ConstantDesc
    Overrides:
    resolveConstantDesc in class DynamicConstantDesc<E extends Enum<E>>
    Parameters:
    lookup - The MethodHandles.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

    method:toString() [NONE]

    toString

    public String 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 class DynamicConstantDesc<E extends Enum<E>>
    Returns:
    A compact textual description of this call site descriptor

    © 2023 Oracle Corporation and/or its affiliates