Interface RecordV2
- All Superinterfaces:
Bytes
An immutable value representing a list of records.
- Since:
- 6.0
- Author:
- DiffusionData Limited
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionasFields()Returns the data value as a list of fields.Parses the value into a model based upon a specified schema.Returns the data value as a list of lists of strings.asValidatedModel(Schema schema) Parses the value into a model based upon a specified schema.Compare this value with an earlier version to calculate a structural delta.Methods inherited from interface com.pushtechnology.diffusion.datatype.Bytes
asInputStream, copyTo, length, toByteArray
-
Method Details
-
diff
Compare this value with an earlier version to calculate a structural delta.- Parameters:
original- the original value to compare with this value- Returns:
- a structural delta representing the difference between the original and this value
-
asModel
Parses the value into a model based upon a specified schema.This assumes that data is compatible with the schema and does not do any validation. There is no need to validate the data if this has been done on entry or at the server. However, if the data is invalid then issues may occur when attempting to access it.
If it is not certain that the data is valid then the
asValidatedModel(Schema)method may be used instead.- Parameters:
schema- the schema to use for parsing the data- Returns:
- an immutable model derived from the data value
-
asValidatedModel
Parses the value into a model based upon a specified schema.- Parameters:
schema- the schema to use for parsing the data- Returns:
- a model derived from the value
- Throws:
InvalidDataException- if the data value is incompatible with the supplied schema
-
asRecords
Returns the data value as a list of lists of strings.- Returns:
- new mutable list where each entry represents a record within the data
-
asFields
Returns the data value as a list of fields.This disregards record boundaries. If there is more than one record, they are concatenated to produce a list of all of the fields.
This method would normally only be used when it is known that there is only one record.
- Returns:
- new mutable list of all of the fields
-