Package org.refcodes.tabular
Interface HeaderRow<T,C extends Column<? extends T>>
-
- Type Parameters:
T
- The type managed by theHeaderRow
.C
- the generic type
- All Superinterfaces:
org.refcodes.structure.Clearable
,java.util.Collection<T>
,ColumnRow<T,C>
,java.lang.Iterable<T>
,org.refcodes.structure.Keys<T,C>
,org.refcodes.structure.Keys.MutableKeys<T,C>
,java.util.List<C>
- All Known Subinterfaces:
FormattedHeader<T>
,Header<T>
- All Known Implementing Classes:
AbstractHeader
,FormattedHeaderImpl
,HeaderImpl
public interface HeaderRow<T,C extends Column<? extends T>> extends ColumnRow<T,C>, java.util.List<C>
A list ofColumn
instances, for example describing the elements of a CSV file (visually speaking the of the CSV file's header line), is represented by theHeaderRow
. TheHeaderRow
preserves an order for a list ofColumn
instances. AHeaderRow
provides the semantics for relatedRow
instances.The
Keys.keySet()
method must provide a predictable order as ensured by theLinkedHashSet
class as of the ordered nature of theHeaderRow
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Record<T>
fromStorageString(Record<java.lang.String> aStringRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageString(Row<java.lang.String> aStringRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageStringRecord(Record<java.lang.String> aStringRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<T>
fromStorageStringRow(Row<java.lang.String> aStringRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<T>
fromStorageStrings(Record<java.lang.String[]> aStringsRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageStrings(Row<java.lang.String[]> aStringsRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageStringsRecord(Record<java.lang.String[]> aStringsRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<T>
fromStorageStringsRow(Row<java.lang.String[]> aStringsRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.int
indexOf(java.lang.String aKey)
Determines the index of the column with the given key or -1 if there is none such column.Record<java.lang.String>
toPrintable(Record<? extends T> aRecord)
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes).Row<java.lang.String>
toPrintable(Row<? extends T> aRow)
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes).Record<java.lang.String>
toPrintableRecord(Row<? extends T> aRow)
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes).Row<java.lang.String>
toPrintableRow(Record<? extends T> aRecord)
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes).Record<T>
toRecord(Row<? extends T> aRow)
Record<?>
toRecordIgnoreType(Row<?> aRow)
Similar totoRecord(Row)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).Row<T>
toRow(Record<? extends T> aRecord)
Row<?>
toRowIgnoreType(Record<?> aRecord)
Similar totoRow(Record)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).Record<java.lang.String>
toStorageString(Record<? extends T> aRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<java.lang.String>
toStorageString(Row<? extends T> aRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<java.lang.String>
toStorageStringRecord(Row<? extends T> aRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<java.lang.String>
toStorageStringRow(Record<? extends T> aRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<java.lang.String[]>
toStorageStrings(Record<? extends T> aRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<java.lang.String[]>
toStorageStrings(Row<? extends T> aRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<java.lang.String[]>
toStorageStringsRecord(Row<? extends T> aRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<java.lang.String[]>
toStorageStringsRow(Record<? extends T> aRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.-
Methods inherited from interface org.refcodes.tabular.ColumnRow
containsValue, withColumns
-
Methods inherited from interface org.refcodes.structure.Keys
containsKey, get, getOr, keySet, use, values
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
indexOf
int indexOf(java.lang.String aKey)
Determines the index of the column with the given key or -1 if there is none such column.- Parameters:
aKey
- The key for which to get the column index.- Returns:
- The index or -1 if there is none such column.
-
toRow
Row<T> toRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Creates aRow
of theRecord
with the values in the order of theHeaderRow
. This method is kind of "strong typed" as any type mismatch between theColumn
defined in theHeaderRow
and the according value of theRecord
we get aColumnMismatchException
.- Parameters:
aRecord
- TheRecord
to use when creating theRow
.- Returns:
- The
Row
according to theColumn
instances of theHeaderRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
toRowIgnoreType
Row<?> toRowIgnoreType(Record<?> aRecord) throws HeaderMismatchException
Similar totoRow(Record)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).- Parameters:
aRecord
- TheRecord
to use when creating theRow
.- Returns:
- The
Row
according to theColumn
instances of theHeaderRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.
-
toRecord
Record<T> toRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Creates aRecord
of theRow
with the values in the order of theHeaderRow
. This method is kind of "strong typed" as any type mismatch between theColumn
defined in theHeaderRow
and the according value of theRow
we get aColumnMismatchException
.- Parameters:
aRow
- TheRecord
to use when creating theRecord
.- Returns:
- The
Row
according to theColumn
instances of theHeaderRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
toRecordIgnoreType
Record<?> toRecordIgnoreType(Row<?> aRow) throws HeaderMismatchException
Similar totoRecord(Row)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).- Parameters:
aRow
- TheRecord
to use when creating theRecord
.- Returns:
- The
Row
according to theColumn
instances of theHeaderRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.
-
toStorageString
Row<java.lang.String> toStorageString(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
of the given type to aRow
containing onlyString
values and viafromStorageString(Row)
back to the actualRow
(bijective). This method may use aColumn
instance's methodColumn.toStorageString(Object)
.- Parameters:
aRow
- theRow
to be converted to aString
Row
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageString
Row<T> fromStorageString(Row<java.lang.String> aStringRow) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
objects to aRow
with the given types and viatoStorageString(Row)
back to theString
Row
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Parameters:
aStringRow
- theString
Row
to be converted to a typeRow
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possiblejava.lang.UnsupportedOperationException
- in case this operation is not supported.
-
toStorageString
Record<java.lang.String> toStorageString(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
of the given type to aRecord
containing onlyString
values and viafromStorageString(Record)
back to the actualRecord
(bijective). This method may use aColumn
instance's methodColumn.toStorageString(Object)
.- Parameters:
aRecord
- theRecord
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageString
Record<T> fromStorageString(Record<java.lang.String> aStringRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
objects to aRecord
with the given types and viatoStorageString(Record)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Parameters:
aStringRecord
- theString
Record
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possiblejava.lang.UnsupportedOperationException
- in case this operation is not supported.
-
toStorageStrings
Row<java.lang.String[]> toStorageStrings(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
of the given type to aRow
containing onlyString
arrays and viafromStorageStrings(Row)
back to the actualRow
(bijective). This method may use aColumn
instance's methodColumn.toStorageStrings(Object)
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aRow
- theRow
to be converted to aString
Row
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStrings
Row<T> fromStorageStrings(Row<java.lang.String[]> aStringsRow) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
objects to aRow
with the given types and viatoStorageStrings(Row)
back to theString
arrayRow
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aStringsRow
- theString
arrayRow
to be converted to a typeRow
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possiblejava.lang.UnsupportedOperationException
- in case this operation is not supported.
-
toStorageStrings
Record<java.lang.String[]> toStorageStrings(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
of the given type to aRecord
containing onlyString
arrays and viafromStorageStrings(Record)
back to the actualRecord
(bijective). This method may use aColumn
instance's methodColumn.toStorageStrings(Object)
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aRecord
- theRecord
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStrings
Record<T> fromStorageStrings(Record<java.lang.String[]> aStringsRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
objects to aRecord
with the given types and viatoStorageStrings(Record)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aStringsRecord
- theString
arrayRecord
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possiblejava.lang.UnsupportedOperationException
- in case this operation is not supported.
-
toPrintable
Record<java.lang.String> toPrintable(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes). This method enables theHeaderRow
to convert a value of the given type to a human readable text. The human readable text, in comparison to the methodtoStorageString(Record)
(ortoStorageStrings(Record)
) is not intended to be converted back to the actual value (not bijective). This method may use aColumn
instance's methodColumn.toPrintable(Object)
; it also might enrich the output of theColumn.toPrintable(Object)
with device specific additional data such as ANSI Escape-Codes and with information regarding theRecord
as a whole and not just be regarding a single value.- Parameters:
aRecord
- theRecord
to be converted to a human readable textRecord
.- Returns:
- The human readable representation of the
Record
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
toPrintable
Row<java.lang.String> toPrintable(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes). This method enables theHeaderRow
to convert a value of the given type to a human readable text. The human readable text, in comparison to the methodtoStorageString(Row)
(ortoStorageStrings(Row)
) is not intended to be converted back to the actual value (not bijective). This method may use aColumn
instance's methodColumn.toPrintable(Object)
; it also might enrich the output of theColumn.toPrintable(Object)
with device specific additional data such as ANSI Escape-Codes and with information regarding theRow
as a whole and not just be regarding a single value.- Parameters:
aRow
- theRow
to be converted to a human readable textRow
.- Returns:
- The human readable representation of the
Row
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringRecord
Row<T> fromStorageStringRecord(Record<java.lang.String> aStringRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
objects to aRow
with the given types and viatoStorageStringRecord(Row)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Parameters:
aStringRecord
- theString
Record
to be converted to a typeRow
.- Returns:
- The type
Row
representation of theString
Record
. - Throws:
java.text.ParseException
- in case parsing the input was not possibleHeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.
-
toStorageStringRecord
Record<java.lang.String> toStorageStringRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
of the given type to aRecord
containing onlyString
values and viafromStorageStringRecord(Record)
back to the actualRow
(bijective). This method may use aColumn
instance's methodColumn.toStorageString(Object)
.- Parameters:
aRow
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringRow
Record<T> fromStorageStringRow(Row<java.lang.String> aStringRow) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
objects to aRecord
with the given types and viatoStorageStringRow(Record)
back to theString
Row
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Parameters:
aStringRow
- theString
Row
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possiblejava.lang.UnsupportedOperationException
- in case this operation is not supported.
-
toStorageStringRow
Row<java.lang.String> toStorageStringRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
of the given type to aRow
containing onlyString
values and viafromStorageStringRecord(Record)
back to the actualRecord
(bijective). This method may use aColumn
instance's methodColumn.toStorageString(Object)
.- Parameters:
aRecord
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringsRecord
Row<T> fromStorageStringsRecord(Record<java.lang.String[]> aStringsRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
arrays to aRow
with the given types and viatoStorageStringsRecord(Row)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aStringsRecord
- theString
Record
to be converted to a typeRow
.- Returns:
- The type
Row
representation of theString
Record
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possible
-
toStorageStringsRecord
Record<java.lang.String[]> toStorageStringsRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
of the given type to aRecord
containing onlyString
arrays and viafromStorageStringsRecord(Record)
back to the actualRow
(bijective). This method may use aColumn
instance's methodColumn.toStorageStrings(Object)
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aRow
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringsRow
Record<T> fromStorageStringsRow(Row<java.lang.String[]> aStringsRow) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
arrays to aRecord
with the given types and viatoStorageStringsRow(Record)
back to theString
Row
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aStringsRow
- theString
Row
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.java.text.ParseException
- in case parsing the input was not possiblejava.lang.UnsupportedOperationException
- in case this operation is not supported.
-
toStorageStringsRow
Row<java.lang.String[]> toStorageStringsRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
of the given type to aRow
containing onlyString
arrays and viafromStorageStringsRecord(Record)
back to the actualRecord
(bijective). This method may use aColumn
instance's methodColumn.toStorageStrings(Object)
. SupportingString
arrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Parameters:
aRecord
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
toPrintableRow
Row<java.lang.String> toPrintableRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes). This method enables theHeaderRow
to convert a value of the given type to a human readable text. The human readable text, in comparison to the methodtoRow(Record)
(ortoStorageStringsRecord(Row)
is not intended to be converted back to the actual value (not bijective). This method may use aColumn
instance's methodColumn.toPrintable(Object)
; it also might enrich the output of theColumn.toPrintable(Object)
with device specific additional data such as ANSI Escape-Codes and with information regarding theRecord
as a whole and not just be regarding a single value.- Parameters:
aRecord
- theRecord
to be converted to a human readable textRow
.- Returns:
- The human readable
Row
representation of theRecord
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
toPrintableRecord
Record<java.lang.String> toPrintableRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumn
implementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes). This method enables theHeaderRow
to convert aRow
of the given type to a human readable textRecord
. The human readable text, in comparison to the methodtoStorageString(Row)
(ortoRecordIgnoreType(Row)
) is not intended to be converted back to the actual value (not bijective). This method may use aColumn
instance's methodColumn.toPrintable(Object)
; it also might enrich the output of theColumn.toPrintable(Object)
with device specific additional data such as ANSI Escape-Codes and with information regarding theRow
as a whole and not just be regarding a single value.- Parameters:
aRow
- theRow
to be converted to a human readable textRecord
.- Returns:
- The human readable
Record
representation of theRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and theRow
, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
-