Enum JavaConstant.MethodHandle.HandleType

java.lang.Object
java.lang.Enum<JavaConstant.MethodHandle.HandleType>
net.bytebuddy.utility.JavaConstant.MethodHandle.HandleType
All Implemented Interfaces:
Serializable, Comparable<JavaConstant.MethodHandle.HandleType>, java.lang.constant.Constable
Enclosing class:
JavaConstant.MethodHandle

public static enum JavaConstant.MethodHandle.HandleType extends Enum<JavaConstant.MethodHandle.HandleType>
A representation of a method handle's type.
  • Enum Constant Details

  • Field Details

    • identifier

      private final int identifier
      The represented identifier.
    • field

      private final boolean field
      true if this handle type represents a field handle.
  • Constructor Details

    • HandleType

      private HandleType(int identifier, boolean field)
      Creates a new handle type.
      Parameters:
      identifier - The represented identifier.
      field - true if this handle type represents a field handle.
  • Method Details

    • values

      public static JavaConstant.MethodHandle.HandleType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static JavaConstant.MethodHandle.HandleType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      Extracts a handle type for invoking the given method.
      Parameters:
      methodDescription - The method for which a handle type should be found.
      Returns:
      The handle type for the given method.
    • of

      protected static JavaConstant.MethodHandle.HandleType of(int identifier)
      Extracts a handle type for the given identifier.
      Parameters:
      identifier - The identifier to extract a handle type for.
      Returns:
      The representing handle type.
    • ofSpecial

      protected static JavaConstant.MethodHandle.HandleType ofSpecial(MethodDescription.InDefinedShape methodDescription)
      Extracts a handle type for invoking the given method via invokespecial.
      Parameters:
      methodDescription - The method for which a handle type should be found.
      Returns:
      The handle type for the given method.
    • ofGetter

      protected static JavaConstant.MethodHandle.HandleType ofGetter(FieldDescription.InDefinedShape fieldDescription)
      Extracts a handle type for a getter of the given field.
      Parameters:
      fieldDescription - The field for which to create a getter handle.
      Returns:
      The corresponding handle type.
    • ofSetter

      protected static JavaConstant.MethodHandle.HandleType ofSetter(FieldDescription.InDefinedShape fieldDescription)
      Extracts a handle type for a setter of the given field.
      Parameters:
      fieldDescription - The field for which to create a setter handle.
      Returns:
      The corresponding handle type.
    • getIdentifier

      public int getIdentifier()
      Returns the represented identifier.
      Returns:
      The represented identifier.
    • isField

      public boolean isField()
      Returns true if this handle type represents a field handle.
      Returns:
      true if this handle type represents a field handle.