Interface ConvertInstruction
- All Superinterfaces:
ClassFileElement
,CodeElement
,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 Summary
Modifier and TypeMethodDescriptionfromType()
Returns the source type to convert from.static ConvertInstruction
Returns a conversion instruction.static ConvertInstruction
Returns A conversion instruction.toType()
Returns the destination type to convert to.Methods declared in interface java.lang.classfile.Instruction
opcode, sizeInBytes
-
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
Returns A conversion instruction.- Parameters:
fromType
- the type to convert fromtoType
- the type to convert to- Returns:
- A conversion instruction
-
of
Returns a conversion instruction.- Parameters:
op
- the opcode for the specific type of conversion instruction, which must be of kindOpcode.Kind.CONVERT
- Returns:
- a conversion instruction
- Throws:
IllegalArgumentException
- if the opcode kind is notOpcode.Kind.CONVERT
.
-