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
-StructureContext
that contains this fieldfieldInfo
-FieldMappingInfo
immutable information about this fielddtc
-DataTypeComponent
that this field maps toreader
-BinaryReader
to 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
ConstructorDescriptionFieldContext
(StructureContext<T> structureContext, FieldMappingInfo<T> fieldInfo, DataTypeComponent dtc, BinaryReader reader) Creates an instance of aFieldContext
record class. -
Method Summary
Modifier and TypeMethodDescriptiondtc()
Returns the value of thedtc
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefieldInfo
record component.Returns the address of this structure field.Returns the structure instance that contains this field.<R> R
Returns the value of this java field.final int
hashCode()
Returns a hash code value for this object.reader()
Returns the value of thereader
record component.Returns the value of thestructureContext
record component.final String
toString()
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 aFieldContext
record class.- Parameters:
structureContext
- the value for thestructureContext
record componentfieldInfo
- the value for thefieldInfo
record componentdtc
- the value for thedtc
record componentreader
- the value for thereader
record 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 thestructureContext
record component.- Returns:
- the value of the
structureContext
record component
-
fieldInfo
Returns the value of thefieldInfo
record component.- Returns:
- the value of the
fieldInfo
record component
-
dtc
Returns the value of thedtc
record component.- Returns:
- the value of the
dtc
record component
-
reader
Returns the value of thereader
record component.- Returns:
- the value of the
reader
record component
-