-
- Type Parameters:
T
- The type managed by theRecord
.
- All Known Implementing Classes:
RecordImpl
public interface Record<T> extends Map<String,T>
ARecord
is aMap
containingField
data structures with support forColumn
definitions. TheField
instances can be managed with the functionality provided by aColumn
.A value can be retrieved from a
Record
by providing an accordingColumn
definition, which verifies the value type. Also values can be converted to and from the appropriate interchange and string formats by the accordingColumn
instances.In contrast to a
Row
, aRecord
relates the key (name) to its values. Similar to aRow
, aRecord
makes use ofColumn
instances (for example as provided by aHeader
or aHeader
instance) to give the fields additional semantics.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Set<Field<T>>
toFieldSet()
default Record<T>
toPurged()
default <TYPE> TYPE
toType(Class<TYPE> aClass)
Converts the content of theRecord
to the according type.-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
toPurged
default Record<T> toPurged()
ThisRecord
is taken and only all non null values are taken for the returnedRecord
. In case of string objects, onlyString
instances with a length greater than zero are taken into account for the returnedRecord
.- Returns:
- The output
Record
without any keys which's values were null or in case of strings which's length was zero.
-
toType
default <TYPE> TYPE toType(Class<TYPE> aClass)
Converts the content of theRecord
to the according type. TheHeader
keys must match the type's properties.- Type Parameters:
TYPE
- The type of the element to which the line to be read is to be converted to.- Parameters:
aClass
- the type of the instance to be created.- Returns:
- The instance of the type to which the
Record
is being converted to.
-
-