public interface Record
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all fields in this record.
|
Set<Field> |
fields()
Returns a set containing all the fields in this record.
|
Object |
getFieldValue(Field field)
Returns the value associated with the given field.
|
long |
getPosition()
Returns the record's position inside its resource, typically the
line number if the resource is a file, or the row number, if the resource is a database table.
|
URI |
getResource()
Returns the record's resource location, typically the file or database table where it was
extracted from.
|
Object |
getSource()
Returns the record source, typically a line in a file or a row in a database table.
|
Collection<Object> |
values()
Returns a collection containing all the values in this record.
|
@Nullable Object getSource()
@NonNull URI getResource()
Details about the returned URI, and in particular its scheme, are implementation-specific.
long getPosition()
Note that in the case of a file, the record's position is not necessarily equal to the line number where it appears. First, if there is one or more header lines, the actual line number would be its position + the number of header lines. Moreover, it the resource contains multi-line records, then it is not possible to draw a direct relationship between the record's position and its line.
Positions should be 1-based, i.e., the first record in the resource has position 1, and so on. If the position cannot be determined, this method should return -1.
@NonNull Set<Field> fields()
@NonNull Collection<Object> values()
The iteration order of this collection should match that of fields().
@Nullable Object getFieldValue(@NonNull Field field)
Note that a return value of null may indicate that the record contains no such
field, or that the field value was null.
field - the field.void clear()
This method should be used to free memory, when this record's fields have been successfully processed and are no longer required.
Copyright © 2017–2021 DataStax. All rights reserved.