Turns the content of a CSV cell into an A
.
Turns the content of a CSV cell into an A
.
Turns the content of the specified cell into an A
.
Turns the content of the specified cell into an A
.
The purpose of this method is to protect against index out of bound exceptions. Should the specified index not exist, a DecodeResult.DecodeFailure instance will be returned.
Turns an instance of CellDecoder[A]
into one of CellDecoder[B]
.
Turns an instance of CellDecoder[A]
into one of CellDecoder[B]
.
This allows developers to adapt existing instances of CellDecoder rather than write one from scratch.
Decodes CSV cells into usable types.
By itself, an instance of CellDecoder is not terribly interesting. It becomes useful when combined with RowDecoder, which relies on any implicit CellDecoder it has in scope to parse entire rows.
If, for example, you need to parse CSV data that contains ISO 8601 formatted dates, you can't immediately call CsvInput.reader with a type argument of
List[Date]
: dates are not supported natively (because they can be serialised in so many different ways).This can be remedied simply by writing the following:
See the companion object for default implementations and construction methods.
Tutorial