Package io.github.zazalng.entity
Class DBFRow
java.lang.Object
io.github.zazalng.entity.DBFRow
Represents a single record (row) of data from a DBF file.
This class reads and decodes the raw bytes of a record based on the provided
DBFField descriptors and stores the results as a map of field names to decoded Java objects.
- Since:
- 1.0.0
- Author:
- Zazalng
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDBFRow(List<DBFField> fields, ByteBuffer buffer, Charset charset) Constructs a new DBFRow by reading and decoding the raw bytes from the buffer. -
Method Summary
-
Constructor Details
-
DBFRow
Constructs a new DBFRow by reading and decoding the raw bytes from the buffer.- Parameters:
fields- The list of field descriptors defining the record structure.buffer- TheByteBuffercontaining the raw record data, starting with the deletion flag.charset- The character set to use for decoding text-based fields.
-
-
Method Details
-
get
Retrieves the decoded value for a field by its name.- Parameters:
name- The name of the field (case-sensitive, matching theDBFFieldname).- Returns:
- The decoded value as a Java object, or
nullif the field is not present or the data was null/empty.
-
getValues
Retrieves the Map Object of this row- Returns:
- Row information as Map Object
-
asMap
Returns the contents of the row as an unmodifiable Map. The keys are the field names (String) and the values are the decoded objects (Object).- Returns:
- An unmodifiable map containing all field names and their decoded values.
-
toString
Provides a string representation of the row's values.
-