Interface ConvertInstruction

All Superinterfaces:
ClassFileElement, CodeElement, Instruction

public sealed interface ConvertInstruction extends Instruction
Models a primitive conversion instruction in the code array of a Code attribute, such as i2l. Corresponding opcodes will have a kind of Opcode.Kind.CONVERT. Delivered as a CodeElement when traversing the elements of a CodeModel.
Since:
24
  • Method Details

    • fromType

      TypeKind fromType()
      Returns the source type to convert from.
      Returns:
      the source type to convert from
    • toType

      TypeKind toType()
      Returns the destination type to convert to.
      Returns:
      the destination type to convert to
    • of

      static ConvertInstruction of(TypeKind fromType, TypeKind toType)
      Returns A conversion instruction.
      Parameters:
      fromType - the type to convert from
      toType - the type to convert to
      Returns:
      A conversion instruction
    • of

      static ConvertInstruction of(Opcode op)
      Returns a conversion instruction.
      Parameters:
      op - the opcode for the specific type of conversion instruction, which must be of kind Opcode.Kind.CONVERT
      Returns:
      a conversion instruction
      Throws:
      IllegalArgumentException - if the opcode kind is not Opcode.Kind.CONVERT.