@HashCodeAndEqualsPlugin.Enhance protected static class EqualsMethod.ConditionalReturn extends java.lang.Object implements StackManipulation
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial
Modifier and Type | Field and Description |
---|---|
private static java.lang.Object[] |
EMPTY
An empty array.
|
private int |
jumpCondition
The conditional jump instruction upon which the return is not triggered.
|
private int |
value
The opcode for the value being returned.
|
Modifier | Constructor and Description |
---|---|
protected |
ConditionalReturn(int jumpCondition)
Creates a conditional return for a value of
false . |
private |
ConditionalReturn(int jumpCondition,
int value)
Creates a conditional return.
|
Modifier and Type | Method and Description |
---|---|
StackManipulation.Size |
apply(org.objectweb.asm.MethodVisitor methodVisitor,
Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.
|
boolean |
isValid()
Determines if this stack manipulation is valid.
|
protected static EqualsMethod.ConditionalReturn |
onIdentity()
Returns a conditional return that returns if two reference values are identical.
|
protected static EqualsMethod.ConditionalReturn |
onNonEqualInteger()
Returns a conditional return that returns if two
int values are not equal. |
protected static EqualsMethod.ConditionalReturn |
onNonIdentity()
Returns a conditional return that returns if two reference values are not identical.
|
protected static EqualsMethod.ConditionalReturn |
onNonZeroInteger()
Returns a conditional return that returns on an
int value of not 0 . |
protected static EqualsMethod.ConditionalReturn |
onNullValue()
Returns a conditional return that returns on a reference value of
null . |
protected static EqualsMethod.ConditionalReturn |
onZeroInteger()
Returns a conditional return that returns on an
int value of 0 . |
protected StackManipulation |
returningTrue()
Returns a new stack manipulation that returns
true for the given condition. |
private static final java.lang.Object[] EMPTY
private final int jumpCondition
private final int value
protected ConditionalReturn(int jumpCondition)
false
.jumpCondition
- The opcode upon which the return is not triggered.private ConditionalReturn(int jumpCondition, int value)
jumpCondition
- The opcode upon which the return is not triggered.value
- The opcode for the value being returned.protected static EqualsMethod.ConditionalReturn onZeroInteger()
int
value of 0
.int
value of 0
.protected static EqualsMethod.ConditionalReturn onNonZeroInteger()
int
value of not 0
.int
value of not 0
.protected static EqualsMethod.ConditionalReturn onNullValue()
null
.null
.protected static EqualsMethod.ConditionalReturn onNonIdentity()
protected static EqualsMethod.ConditionalReturn onIdentity()
protected static EqualsMethod.ConditionalReturn onNonEqualInteger()
int
values are not equal.int
values are not equal.protected StackManipulation returningTrue()
true
for the given condition.true
for the given condition.public boolean isValid()
isValid
in interface StackManipulation
false
, this manipulation cannot be applied and should throw an exception.public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
apply
in interface StackManipulation
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.