T
- The type managed by the Header
.public class HeaderImpl<T> extends ArrayList<Column<? extends T>> implements Header<T>, Cloneable
Keys.ClearableKeys<K,V>, Keys.MutableKeys<K,V>
modCount
Constructor and Description |
---|
HeaderImpl()
Constructs the
HeaderImpl instance. |
HeaderImpl(Column<? extends T>... aHeader)
Constructs the
HeaderImpl instance configured with the provided
Column instances. |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Column<? extends T> aColumn) |
void |
add(int aIndex,
Column<? extends T> aColumn) |
boolean |
containsKey(String aKey) |
Record<T> |
fromStorageString(Record<String> aStringRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<T> |
fromStorageString(Row<String> aStringRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<T> |
fromStorageStringRecord(Record<String> aStringRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Record<T> |
fromStorageStringRow(Row<String> aStringRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Record<T> |
fromStorageStrings(Record<String[]> aStringsRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<T> |
fromStorageStrings(Row<String[]> aStringsRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<T> |
fromStorageStringsRecord(Record<String[]> aStringsRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Record<T> |
fromStorageStringsRow(Row<String[]> aStringsRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Column<? extends T> |
get(String aKey) |
int |
indexOf(String aKey)
Determines the index of the column with the given key or -1 if there is
none such column.
|
Set<String> |
keySet()
-------------------------------------------------------------------------
A
LinkedHashSet is returned in order to preserve the order of the
elements as contained in the Header itself |
Column<? extends T> |
removeKey(String aKey) |
Record<String> |
toPrintable(Record<? extends T> aRecord)
A special
Column 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<String> |
toPrintable(Row<? extends T> aRow)
A special
Column 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<String> |
toPrintableRecord(Row<? extends T> aRow)
A special
Column 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<String> |
toPrintableRow(Record<? extends T> aRecord)
A special
Column 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 to
Header.toRecord(Row) with the difference that conversion is
done ignoring the type of the Header Column instances and
the according value(s). |
Row<T> |
toRow(Record<? extends T> aRecord)
|
Row<?> |
toRowIgnoreType(Record<?> aRecord)
Similar to
Header.toRow(Record) with the difference that conversion is
done ignoring the type of the Header Column instances and
the according value(s). |
Record<String> |
toStorageString(Record<? extends T> aRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<String> |
toStorageString(Row<? extends T> aRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Record<String> |
toStorageStringRecord(Row<? extends T> aRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<String> |
toStorageStringRow(Record<? extends T> aRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Record<String[]> |
toStorageStrings(Record<? extends T> aRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<String[]> |
toStorageStrings(Row<? extends T> aRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Record<String[]> |
toStorageStringsRecord(Row<? extends T> aRow)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Row<String[]> |
toStorageStringsRow(Record<? extends T> aRecord)
A special
Column implementation might provide its own text
exchange format for the given objects. |
Collection<Column<? extends T>> |
values() |
addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
public HeaderImpl()
HeaderImpl
instance.@SafeVarargs public HeaderImpl(Column<? extends T>... aHeader)
HeaderImpl
instance configured with the provided
Column
instances.aHeader
- The Column
instances to be contained in the
HeaderImpl
in the order as passed.public boolean containsKey(String aKey)
containsKey
in interface Keys<String,Column<? extends T>>
public Set<String> keySet()
LinkedHashSet
is returned in order to preserve the order of the
elements as contained in the Header
itself.
-------------------------------------------------------------------------public int indexOf(String aKey)
Header
public Column<? extends T> removeKey(String aKey)
removeKey
in interface Keys.MutableKeys<String,Column<? extends T>>
public Record<String> toStorageString(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
of the given type to a
Record
containing only String
values and via
Header.fromStorageString(Record)
back to the actual Record
(bijective).
This method may use a Column
instance's method
Column.toStorageString(Object)
.toStorageString
in interface Header<T>
aRecord
- the Record
to be converted to a String
Record
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given Columns
and the Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Row<String> toStorageString(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
of the given type to a
Row
containing only String
values and via
Header.fromStorageString(Row)
back to the actual Row
(bijective).
This method may use a Column
instance's method
Column.toStorageString(Object)
.toStorageString
in interface Header<T>
aRow
- the Row
to be converted to a String
Row
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Row
of the wrong type than specified by a
Column
of the Header
.public Record<T> fromStorageString(Record<String> aStringRecord) throws HeaderMismatchException, ParseException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
containing only String
objects to a Record
with the given types and via
Header.toStorageString(Record)
back to the String
Record
(bijective).
This method may use a Column
instance's method
Column.fromStorageString(String)
.fromStorageString
in interface Header<T>
aStringRecord
- the String
Record
to be converted to
a type Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given Columns
and the Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Row<T> fromStorageString(Row<String> aStringRow) throws HeaderMismatchException, ParseException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
containing only String
objects to a Row
with the given types and via
Header.toStorageString(Row)
back to the String
Row
(bijective).
This method may use a Column
instance's method
Column.fromStorageString(String)
.fromStorageString
in interface Header<T>
aStringRow
- the String
Row
to be converted to a
type Row
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Record<String[]> toStorageStrings(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
of the given type to a
Record
containing only String
arrays and via
Header.fromStorageStrings(Record)
back to the actual Record
(bijective).
This method may use a Column
instance's method
Column.toStorageStrings(Object)
.
Supporting String
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).toStorageStrings
in interface Header<T>
aRecord
- the Record
to be converted to a String
Record
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given Columns
and the Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Row<String[]> toStorageStrings(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
of the given type to a
Row
containing only String
arrays and via
Header.fromStorageStrings(Row)
back to the actual Row
(bijective).
This method may use a Column
instance's method
Column.toStorageStrings(Object)
.
Supporting String
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).toStorageStrings
in interface Header<T>
aRow
- the Row
to be converted to a String
Row
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Row
of the wrong type than specified by a
Column
of the Header
.public Row<T> fromStorageStrings(Row<String[]> aStringsRow) throws HeaderMismatchException, ParseException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
containing only String
objects to a Row
with the given types and via
Header.toStorageStrings(Row)
back to the String
array
Row
(bijective).
This method may use a Column
instance's method
Column.fromStorageStrings(String[])
.
Supporting String
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).fromStorageStrings
in interface Header<T>
aStringsRow
- the String
array Row
to be converted
to a type Row
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Record<T> fromStorageStrings(Record<String[]> aStringsRecord) throws HeaderMismatchException, ParseException
Header
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
containing only String
objects to a Record
with the given types and via
Header.toStorageStrings(Record)
back to the String
Record
(bijective).
This method may use a Column
instance's method
Column.fromStorageStrings(String[])
.
Supporting String
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).fromStorageStrings
in interface Header<T>
aStringsRecord
- the String
array Record
to be
converted to a type Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given Columns
and the Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Record<String> toPrintable(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Header
Column
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 the Header
to
convert a value of the given type to a human readable text. The human
readable text, in comparison to the method
Header.toStorageString(Record)
(or Header.toStorageStrings(Record)
)
is not intended to be converted back to the actual value (not bijective).
This method may use a Column
instance's method
Column.toPrintable(Object)
; it also might enrich the output of
the Column.toPrintable(Object)
with device specific additional
data such as ANSI escape codes and with information regarding the
Record
as a whole and not just be regarding a single value.toPrintable
in interface Header<T>
aRecord
- the Record
to be converted to a human readable
text Record
.Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given Columns
and the Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Row<String> toPrintable(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Header
Column
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 the Header
to
convert a value of the given type to a human readable text. The human
readable text, in comparison to the method Header.toStorageString(Row)
(or Header.toStorageStrings(Row)
) is not intended to be converted back
to the actual value (not bijective).
This method may use a Column
instance's method
Column.toPrintable(Object)
; it also might enrich the output of
the Column.toPrintable(Object)
with device specific additional
data such as ANSI escape codes and with information regarding the
Row
as a whole and not just be regarding a single value.toPrintable
in interface Header<T>
aRow
- the Row
to be converted to a human readable text
Row
.Row
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Row
of the wrong type than specified by a
Column
of the Header
.public Row<T> toRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Header
Row
of the Record
with the values in the order
of the Header
. This method is kind of "strong typed" as any type
mismatch between the Column
defined in the Header
and the
according value of the Record
we get a
ColumnMismatchException
.
If you want to get a Row
in any case use the "weak typed"
TabularUtility#toUncheckedRow(Record,Header)
method which will
create a Row
even if there is a column type mismatch.
/////////////////////////////////////////////////////////////////////////
In order to get separated values (CSV),use the Header.toRow(Record)
or
TabularUtility#toUncheckedRow(Record,Header)
methods as only in
conjunction with an order of a Header
we can retrieve valid
separated values.
/////////////////////////////////////////////////////////////////////////toRow
in interface Header<T>
aRecord
- The Record
to use when creating the Row
.Row
according to the Column
instances of the
Header
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Row<?> toRowIgnoreType(Record<?> aRecord) throws HeaderMismatchException
Header
Header.toRow(Record)
with the difference that conversion is
done ignoring the type of the Header
Column
instances and
the according value(s).toRowIgnoreType
in interface Header<T>
aRecord
- The Record
to use when creating the Row
.Row
according to the Column
instances of the
Header
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.public Record<T> toRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Header
Record
of the Row
with the values in the order
of the Header
. This method is kind of "strong typed" as any type
mismatch between the Column
defined in the Header
and the
according value of the Row
we get a
ColumnMismatchException
. If you want to get a Row
in any
case use the "weak typed"
TabularUtility#toUncheckedRecord(Row,Header)
method which will
create a Row
even if there is a column type mismatch.
/////////////////////////////////////////////////////////////////////////
In order to get separated values (CSV),use the Header.toRow(Record)
or
TabularUtility#toUncheckedRecord(Row,Header)
methods as only in
conjunction with an order of a Header
we can retrieve valid
separated values.
/////////////////////////////////////////////////////////////////////////toRecord
in interface Header<T>
aRow
- The Record
to use when creating the Record
.Row
according to the Column
instances of the
Header
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Record<?> toRecordIgnoreType(Row<?> aRow) throws HeaderMismatchException
Header
Header.toRecord(Row)
with the difference that conversion is
done ignoring the type of the Header
Column
instances and
the according value(s).toRecordIgnoreType
in interface Header<T>
aRow
- The Record
to use when creating the Record
.Row
according to the Column
instances of the
Header
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.public Row<T> fromStorageStringRecord(Record<String> aStringRecord) throws HeaderMismatchException, ParseException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
containing only String
objects to a Row
with the given types and via
Header.toStorageStringRecord(Row)
back to the String
Record
(bijective).
This method may use a Column
instance's method
Column.fromStorageString(String)
.
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------fromStorageStringRecord
in interface Header<T>
aStringRecord
- the String
Record
to be converted to
a type Row
.Row
representation of the String
Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Record<String> toStorageStringRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
of the given type to a
Record
containing only String
values and via
Header.fromStorageStringRecord(Record)
back to the actual Row
(bijective).
This method may use a Column
instance's method
Column.toStorageString(Object)
.
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------toStorageStringRecord
in interface Header<T>
aRow
- The Row
to be converted to a String
Record
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Row
of the wrong type than specified by a
Column
of the Header
.public Record<T> fromStorageStringRow(Row<String> aStringRow) throws HeaderMismatchException, ParseException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
containing only String
objects to a Record
with the given types and via
#toStringRow(Record)
back to the String
Row
(bijective).
This method may use a Column
instance's method
Column.fromStorageString(String)
.
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------fromStorageStringRow
in interface Header<T>
aStringRow
- the String
Row
to be converted to a
type Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Row<String> toStorageStringRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
of the given type to a
Row
containing only String
values and via
Header.fromStorageStringRecord(Record)
back to the actual
Record
(bijective).
This method may use a Column
instance's method
Column.toStorageString(Object)
.
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------toStorageStringRow
in interface Header<T>
aRecord
- The Row
to be converted to a String
Record
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Row<T> fromStorageStringsRecord(Record<String[]> aStringsRecord) throws HeaderMismatchException, ParseException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
containing only String
arrays to a Row
with the given types and via
Header.toStorageStringsRecord(Row)
back to the String
Record
(bijective).
This method may use a Column
instance's method
Column#fromStorageStrings(String)
.
Supporting String
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).
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------fromStorageStringsRecord
in interface Header<T>
aStringsRecord
- the String
Record
to be converted
to a type Row
.Row
representation of the String
Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Record<String[]> toStorageStringsRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
of the given type to a
Record
containing only String
arrays and via
Header.fromStorageStringsRecord(Record)
back to the actual Row
(bijective).
This method may use a Column
instance's method
Column.toStorageStrings(Object)
.
Supporting String
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).
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------toStorageStringsRecord
in interface Header<T>
aRow
- The Row
to be converted to a String
Record
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Row
of the wrong type than specified by a
Column
of the Header
.public Record<T> fromStorageStringsRow(Row<String[]> aStringsRow) throws HeaderMismatchException, ParseException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Row
containing only String
arrays to a Record
with the given types and via
Header.toStorageStringsRow(Record)
back to the String
Row
(bijective).
This method may use a Column
instance's method
Column#fromStorageStrings(String)
.
Supporting String
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).
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------fromStorageStringsRow
in interface Header<T>
aStringsRow
- the String
Row
to be converted to a
type Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ParseException
- in case parsing the input was not possiblepublic Row<String[]> toStorageStringsRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Column
implementation might provide its own text
exchange format for the given objects. This method enables the
Header
to convert a Record
of the given type to a
Row
containing only String
arrays and via
Header.fromStorageStringsRecord(Record)
back to the actual
Record
(bijective).
This method may use a Column
instance's method
Column.toStorageStrings(Object)
.
Supporting String
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).
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------toStorageStringsRow
in interface Header<T>
aRecord
- The Row
to be converted to a String
Record
.String
representation of the value.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Row<String> toPrintableRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Header
Column
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 the Header
to
convert a value of the given type to a human readable text. The human
readable text, in comparison to the method #toStringRow(Record)
(or #toInterchangeableRow(Record)
) is not intended to be
converted back to the actual value (not bijective).
This method may use a Column
instance's method
Column.toPrintable(Object)
; it also might enrich the output of
the Column.toPrintable(Object)
with device specific additional
data such as ANSI escape codes and with information regarding the
Record
as a whole and not just be regarding a single value.toPrintableRow
in interface Header<T>
aRecord
- the Record
to be converted to a human readable
text Row
.Row
representation of the
Record
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Record
of the wrong type than specified by a
Column
of the Header
.public Record<String> toPrintableRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Column
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 the Header
to
convert a Row
of the given type to a human readable text
Record
. The human readable text, in comparison to the method
#toStringRecord(Row)
(or #toInterchangeableRecord(Row)
)
is not intended to be converted back to the actual value (not bijective).
This method may use a Column
instance's method
Column.toPrintable(Object)
; it also might enrich the output of
the Column.toPrintable(Object)
with device specific additional
data such as ANSI escape codes and with information regarding the
Row
as a whole and not just be regarding a single value.
-------------------------------------------------------------------------
TODO !!! STILL TO BE TESTED !!!
-------------------------------------------------------------------------toPrintableRecord
in interface Header<T>
aRow
- the Row
to be converted to a human readable text
Record
.Record
representation of the
Row
.HeaderMismatchException
- Thrown in case there is a mismatch
between the given HeaderMismatchException
and the
Row
, 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 the Header
.ColumnMismatchException
- Thrown in case a value was found in the
e.g. in a Row
of the wrong type than specified by a
Column
of the Header
.Copyright © 2015. All rights reserved.