Package net.bytebuddy.implementation
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
StackManipulation.AbstractBase, StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Simple, StackManipulation.Size, StackManipulation.Trivial
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Object[]
An empty array.private final int
The conditional jump instruction upon which the return is not triggered.private final int
The opcode for the value being returned. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ConditionalReturn
(int jumpCondition) Creates a conditional return for a value offalse
.private
ConditionalReturn
(int jumpCondition, int value) Creates a conditional return. -
Method Summary
Modifier and TypeMethodDescriptionapply
(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the stack manipulation that is described by this instance.protected static EqualsMethod.ConditionalReturn
Returns a conditional return that returns if two reference values are identical.protected static EqualsMethod.ConditionalReturn
Returns a conditional return that returns if twoint
values are not equal.protected static EqualsMethod.ConditionalReturn
Returns a conditional return that returns if two reference values are not identical.protected static EqualsMethod.ConditionalReturn
Returns a conditional return that returns on anint
value of not0
.protected static EqualsMethod.ConditionalReturn
Returns a conditional return that returns on a reference value ofnull
.protected static EqualsMethod.ConditionalReturn
Returns a conditional return that returns on anint
value of0
.protected StackManipulation
Returns a new stack manipulation that returnstrue
for the given condition.Methods inherited from class net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase
isValid
-
Field Details
-
EMPTY
An empty array. -
jumpCondition
private final int jumpConditionThe conditional jump instruction upon which the return is not triggered. -
value
private final int valueThe opcode for the value being returned.
-
-
Constructor Details
-
ConditionalReturn
protected ConditionalReturn(int jumpCondition) Creates a conditional return for a value offalse
.- 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
Returns a conditional return that returns on anint
value of0
.- Returns:
- A conditional return that returns on an
int
value of0
.
-
onNonZeroInteger
Returns a conditional return that returns on anint
value of not0
.- Returns:
- A conditional return that returns on an
int
value of not0
.
-
onNullValue
Returns a conditional return that returns on a reference value ofnull
.- Returns:
- A conditional return that returns on a reference value of
null
.
-
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
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
Returns a conditional return that returns if twoint
values are not equal.- Returns:
- A conditional return that returns if two
int
values are not equal.
-
returningTrue
Returns a new stack manipulation that returnstrue
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.
-