Class EqualsMethod.ConditionalReturn

java.lang.Object
net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
net.bytebuddy.implementation.EqualsMethod.ConditionalReturn
All Implemented Interfaces:
StackManipulation
Enclosing class:
EqualsMethod

@Enhance protected static class EqualsMethod.ConditionalReturn extends StackManipulation.AbstractBase
A conditional return aborts the equality computation if a given condition was reached.
  • Field Details

    • jumpCondition

      private final int jumpCondition
      The conditional jump instruction upon which the return is not triggered.
    • value

      private final int value
      The opcode for the value being returned.
  • Constructor Details

    • ConditionalReturn

      protected ConditionalReturn(int jumpCondition)
      Creates a conditional return for a value of false.
      Parameters:
      jumpCondition - The opcode upon which the return is not triggered.
    • ConditionalReturn

      private ConditionalReturn(int jumpCondition, int value)
      Creates a conditional return.
      Parameters:
      jumpCondition - The opcode upon which the return is not triggered.
      value - The opcode for the value being returned.
  • Method Details

    • onZeroInteger

      protected static EqualsMethod.ConditionalReturn onZeroInteger()
      Returns a conditional return that returns on an int value of 0.
      Returns:
      A conditional return that returns on an int value of 0.
    • onNonZeroInteger

      protected static EqualsMethod.ConditionalReturn onNonZeroInteger()
      Returns a conditional return that returns on an int value of not 0.
      Returns:
      A conditional return that returns on an int value of not 0.
    • onNullValue

      protected static EqualsMethod.ConditionalReturn onNullValue()
      Returns a conditional return that returns on a reference value of null.
      Returns:
      A conditional return that returns on a reference value of null.
    • onNonIdentity

      protected static EqualsMethod.ConditionalReturn onNonIdentity()
      Returns a conditional return that returns if two reference values are not identical.
      Returns:
      A conditional return that returns if two reference values are not identical.
    • onIdentity

      protected static EqualsMethod.ConditionalReturn onIdentity()
      Returns a conditional return that returns if two reference values are identical.
      Returns:
      A conditional return that returns if two reference values are identical.
    • onNonEqualInteger

      protected static EqualsMethod.ConditionalReturn onNonEqualInteger()
      Returns a conditional return that returns if two int values are not equal.
      Returns:
      A conditional return that returns if two int values are not equal.
    • returningTrue

      protected StackManipulation returningTrue()
      Returns a new stack manipulation that returns true for the given condition.
      Returns:
      A new stack manipulation that returns true for the given condition.
    • 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.