Package net.bytebuddy.implementation
Class Implementation.Context.Default.FieldCacheEntry
- java.lang.Object
-
- net.bytebuddy.implementation.Implementation.Context.Default.FieldCacheEntry
-
- All Implemented Interfaces:
StackManipulation
- Enclosing class:
- Implementation.Context.Default
protected static class Implementation.Context.Default.FieldCacheEntry extends java.lang.Object implements StackManipulation
A field cache entry for uniquely identifying a cached field. A cached field is described by the stack manipulation that loads the field's value onto the operand stack and the type of the field.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
fieldType
The field type that is represented by this field cache entry.private StackManipulation
fieldValue
The field value that is represented by this field cache entry.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldCacheEntry(StackManipulation fieldValue, TypeDescription fieldType)
Creates a new field cache entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation.Size
apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.boolean
equals(java.lang.Object other)
protected TypeDescription
getFieldType()
Returns the field type that is represented by this field cache entry.int
hashCode()
boolean
isValid()
Determines if this stack manipulation is valid.protected ByteCodeAppender
storeIn(FieldDescription fieldDescription)
Returns a stack manipulation where the represented value is stored in the given field.
-
-
-
Field Detail
-
fieldValue
private final StackManipulation fieldValue
The field value that is represented by this field cache entry.
-
fieldType
private final TypeDescription fieldType
The field type that is represented by this field cache entry.
-
-
Constructor Detail
-
FieldCacheEntry
protected FieldCacheEntry(StackManipulation fieldValue, TypeDescription fieldType)
Creates a new field cache entry.- Parameters:
fieldValue
- The field value that is represented by this field cache entry.fieldType
- The field type that is represented by this field cache entry.
-
-
Method Detail
-
storeIn
protected ByteCodeAppender storeIn(FieldDescription fieldDescription)
Returns a stack manipulation where the represented value is stored in the given field.- Parameters:
fieldDescription
- A static field in which the value is to be stored.- Returns:
- A byte code appender that represents this storage.
-
getFieldType
protected TypeDescription getFieldType()
Returns the field type that is represented by this field cache entry.- Returns:
- The field type that is represented by this field cache entry.
-
isValid
public boolean isValid()
Determines if this stack manipulation is valid.- Specified by:
isValid
in interfaceStackManipulation
- Returns:
- If
false
, this manipulation cannot be applied and should throw an exception.
-
apply
public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.- Specified by:
apply
in interfaceStackManipulation
- 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.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-