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- Record Components:
structureContext-StructureContextthat contains this fieldfieldInfo-FieldMappingInfoimmutable information about this fielddtc-DataTypeComponentthat this field maps toreader-BinaryReaderto use when reading data, may be null if this context is for markup operations instead of deserialization
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, or being markedup.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldContext(StructureContext<T> structureContext, FieldMappingInfo<T> fieldInfo, DataTypeComponent dtc, BinaryReader reader) Creates an instance of aFieldContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondtc()Returns the value of thedtcrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldInforecord component.Returns the address of this structure field.Returns the structure instance that contains this field.<R> RReturns the value of this java field.final inthashCode()Returns a hash code value for this object.reader()Returns the value of thereaderrecord component.Returns the value of thestructureContextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FieldContext
public FieldContext(StructureContext<T> structureContext, FieldMappingInfo<T> fieldInfo, DataTypeComponent dtc, BinaryReader reader) Creates an instance of aFieldContextrecord class.- Parameters:
structureContext- the value for thestructureContextrecord componentfieldInfo- the value for thefieldInforecord componentdtc- the value for thedtcrecord componentreader- the value for thereaderrecord component
-
-
Method Details
-
getStructureInstance
Returns the structure instance that contains this field.- Returns:
- structure instance that contains this field
-
getAddress
Returns the address of this structure field.- Returns:
- the address of this field
-
getValue
Returns the value of this java field.- Type Parameters:
R- result type- Parameters:
expectedType- class of expected result type- Returns:
- value of this java field, as type R
- Throws:
IOException- if error getting or converting value
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
structureContext
Returns the value of thestructureContextrecord component.- Returns:
- the value of the
structureContextrecord component
-
fieldInfo
Returns the value of thefieldInforecord component.- Returns:
- the value of the
fieldInforecord component
-
dtc
Returns the value of thedtcrecord component.- Returns:
- the value of the
dtcrecord component
-
reader
Returns the value of thereaderrecord component.- Returns:
- the value of the
readerrecord component
-