Class 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.
    • 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 interface StackManipulation
        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 interface StackManipulation
        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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object