Interface TypeCheckInstruction
- All Superinterfaces:
ClassFileElement
,CodeElement
,Instruction
Models an
instanceof
or checkcast
instruction in the
code
array of a Code
attribute. Delivered as a CodeElement
when traversing the elements of a CodeModel
.- Since:
- 24
-
Method Summary
Modifier and TypeMethodDescriptionstatic TypeCheckInstruction
of
(Opcode op, ClassEntry type) Returns a type check instruction.static TypeCheckInstruction
Returns a type check instruction.type()
Returns the type against which the instruction checks or casts.Methods declared in interface java.lang.classfile.Instruction
opcode, sizeInBytes
-
Method Details
-
type
ClassEntry type()Returns the type against which the instruction checks or casts.- Returns:
- the type against which the instruction checks or casts
-
of
Returns a type check instruction.- Parameters:
op
- the opcode for the specific type of type check instruction, which must be of kindOpcode.Kind.TYPE_CHECK
type
- the type against which to check or cast- Returns:
- a type check instruction
- Throws:
IllegalArgumentException
- if the opcode kind is notOpcode.Kind.TYPE_CHECK
.
-
of
Returns a type check instruction.- Parameters:
op
- the opcode for the specific type of type check instruction, which must be of kindOpcode.Kind.TYPE_CHECK
type
- the type against which to check or cast- Returns:
- a type check instruction
-