Package net.bytebuddy.implementation
Class HashCodeMethod.NullValueGuard.UsingJump
java.lang.Object
net.bytebuddy.implementation.HashCodeMethod.NullValueGuard.UsingJump
- All Implemented Interfaces:
HashCodeMethod.NullValueGuard
- Enclosing interface:
- HashCodeMethod.NullValueGuard
@Enhance
public static class HashCodeMethod.NullValueGuard.UsingJump
extends Object
implements HashCodeMethod.NullValueGuard
A null value guard that expects a reference type and that uses a jump if a field value is
null
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
The stack manipulation to apply after the hash value computation.protected class
The stack manipulation to apply before the hash value computation.Nested classes/interfaces inherited from interface net.bytebuddy.implementation.HashCodeMethod.NullValueGuard
HashCodeMethod.NullValueGuard.NoOp, HashCodeMethod.NullValueGuard.UsingJump
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Object[]
An empty array.private final MethodDescription
The instrumented method.private static final Object[]
An array that only contains an integer stack map frame.private final org.objectweb.asm.Label
A label to indicate the target of a jump. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
UsingJump
(MethodDescription instrumentedMethod) Creates a new null value guard using a jump instruction fornull
values. -
Method Summary
-
Field Details
-
EMPTY
An empty array. -
INTEGER
An array that only contains an integer stack map frame. -
instrumentedMethod
The instrumented method. -
label
private final org.objectweb.asm.Label labelA label to indicate the target of a jump.
-
-
Constructor Details
-
UsingJump
Creates a new null value guard using a jump instruction fornull
values.- Parameters:
instrumentedMethod
- The instrumented method.
-
-
Method Details
-
before
Returns a stack manipulation to apply before computing a hash value.- Specified by:
before
in interfaceHashCodeMethod.NullValueGuard
- Returns:
- A stack manipulation to apply before computing a hash value.
-
after
Returns a stack manipulation to apply after computing a hash value.- Specified by:
after
in interfaceHashCodeMethod.NullValueGuard
- Returns:
- A stack manipulation to apply after computing a hash value.
-
getRequiredVariablePadding
public int getRequiredVariablePadding()Returns the required padding for the local variable array to apply this guard.- Specified by:
getRequiredVariablePadding
in interfaceHashCodeMethod.NullValueGuard
- Returns:
- The required padding for the local variable array to apply this guard.
-