Record Class FieldContext<T>

java.lang.Object
java.lang.Record
ghidra.app.util.bin.format.golang.structmapping.FieldContext<T>
Type Parameters:
T - the class that contains this field

public record FieldContext<T>(StructureContext<T> structureContext, FieldMappingInfo<T> fieldInfo, DataTypeComponent dtc, BinaryReader reader) extends Record
Context of an individual field that is being deserialized
  • Constructor Details

    • FieldContext

      public FieldContext(StructureContext<T> structureContext, FieldMappingInfo<T> fieldInfo, DataTypeComponent dtc, BinaryReader reader)
      Creates an instance of a FieldContext record class.
      Parameters:
      structureContext - the value for the structureContext record component
      fieldInfo - the value for the fieldInfo record component
      dtc - the value for the dtc record component
      reader - the value for the reader record component
  • Method Details

    • getStructureInstance

      public T getStructureInstance()
    • getDataTypeMapper

      public DataTypeMapper getDataTypeMapper()
    • appendComment

      public void appendComment(int commentType, String prefix, String comment, String sep) throws IOException
      Throws:
      IOException
    • addReference

      public void addReference(Address refDest) throws IOException
      Throws:
      IOException
    • getAddress

      public Address getAddress()
    • getValue

      public <R> R getValue(Class<R> expectedType) throws IOException
      Throws:
      IOException
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • structureContext

      public StructureContext<T> structureContext()
      Returns the value of the structureContext record component.
      Returns:
      the value of the structureContext record component
    • fieldInfo

      public FieldMappingInfo<T> fieldInfo()
      Returns the value of the fieldInfo record component.
      Returns:
      the value of the fieldInfo record component
    • dtc

      public DataTypeComponent dtc()
      Returns the value of the dtc record component.
      Returns:
      the value of the dtc record component
    • reader

      public BinaryReader reader()
      Returns the value of the reader record component.
      Returns:
      the value of the reader record component