Interface TypeCheckInstruction
- All Superinterfaces:
ClassFileElementPREVIEW,CodeElementPREVIEW,InstructionPREVIEW
TypeCheckInstruction is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models an
instanceof or checkcast instruction in the
code array of a Code attribute. Delivered as a CodeElementPREVIEW
when traversing the elements of a CodeModelPREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionstatic TypeCheckInstructionPREVIEWof(OpcodePREVIEW op, ClassEntryPREVIEW type) Returns a type check instruction.static TypeCheckInstructionPREVIEWReturns a type check instruction.type()Returns the type against which the instruction checks or casts.Methods declared in interface java.lang.classfile.InstructionPREVIEW
opcode, sizeInBytes
-
Method Details
-
type
ClassEntryPREVIEW 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_CHECKPREVIEWtype- the type against which to check or cast- Returns:
- a type check instruction
- Throws:
IllegalArgumentException- if the opcode kind is notOpcode.Kind.TYPE_CHECKPREVIEW.
-
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_CHECKPREVIEWtype- the type against which to check or cast- Returns:
- a type check instruction
-
TypeCheckInstructionwhen preview features are enabled.