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 CodeElement
PREVIEW
when traversing the elements of a CodeModel
PREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionstatic TypeCheckInstructionPREVIEW
of
(OpcodePREVIEW op, ClassEntryPREVIEW type) Returns a type check instruction.static TypeCheckInstructionPREVIEW
Returns 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_CHECK
PREVIEWtype
- the type against which to check or cast- Returns:
- a type check instruction
- Throws:
IllegalArgumentException
- if the opcode kind is notOpcode.Kind.TYPE_CHECK
PREVIEW.
-
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
PREVIEWtype
- the type against which to check or cast- Returns:
- a type check instruction
-
TypeCheckInstruction
when preview features are enabled.