Interface ReturnInstruction

All Superinterfaces:
ClassfileElement, CodeElement, Instruction
All Known Implementing Classes:
AbstractInstruction.UnboundReturnInstruction

public sealed interface ReturnInstruction extends Instruction permits AbstractInstruction.UnboundReturnInstruction
Models a return-from-method instruction in the code array of a Code attribute. Corresponding opcodes will have a kind of Opcode.Kind.RETURN. Delivered as a CodeElement when traversing the elements of a CodeModel.
  • Method Details

    • typeKind

      TypeKind typeKind()
    • of

      static ReturnInstruction of(TypeKind typeKind)
      Returns a return instruction.
      Parameters:
      typeKind - the type of the return instruction
      Returns:
      a return instruction
    • of

      static ReturnInstruction of(Opcode op)
      Returns a return instruction.
      Parameters:
      op - the opcode for the specific type of return instruction, which must be of kind Opcode.Kind.RETURN
      Returns:
      a return instruction