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.AbstractBase, StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Simple, StackManipulation.Size, StackManipulation.Trivial
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescriptionfieldTypeThe field type that is represented by this field cache entry.private StackManipulationfieldValueThe field value that is represented by this field cache entry.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFieldCacheEntry(StackManipulation fieldValue, TypeDescription fieldType)Creates a new field cache entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation.Sizeapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)Applies the stack manipulation that is described by this instance.booleanequals(java.lang.Object other)protected TypeDescriptiongetFieldType()Returns the field type that is represented by this field cache entry.inthashCode()booleanisValid()Determines if this stack manipulation is valid.protected ByteCodeAppenderstoreIn(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:
isValidin 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:
applyin 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(@MaybeNull java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-