Class InstanceCheck

java.lang.Object
net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
net.bytebuddy.implementation.bytecode.assign.InstanceCheck
All Implemented Interfaces:
StackManipulation

@Enhance public class InstanceCheck extends StackManipulation.AbstractBase
Implements an instanceof check.
  • Field Details

    • typeDescription

      private final TypeDescription typeDescription
      The type to apply the instance check against.
  • Constructor Details

    • InstanceCheck

      protected InstanceCheck(TypeDescription typeDescription)
      Creates a new instance check.
      Parameters:
      typeDescription - The type to apply the instance check against.
  • Method Details

    • of

      public static StackManipulation of(TypeDescription typeDescription)
      Creates a new instance check.
      Parameters:
      typeDescription - The type to apply the instance check against.
      Returns:
      An appropriate stack manipulation.
    • apply

      public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
      Applies the stack manipulation that is described by this instance.
      Parameters:
      methodVisitor - The method visitor used to write the method implementation to.
      implementationContext - The context of the current implementation.
      Returns:
      The changes to the size of the operand stack that are implied by this stack manipulation.