Creates a new instance of CellDecoder that uses the specified function to parse data.
Turns a cell into a BigDecimal
value.
Turns a cell into a BigInt
value.
Turns a cell into a Boolean
value.
Turns a cell into a Byte
value.
Turns a cell into a Char
value.
Turns a cell into a Double
value.
Turns a cell into an instance of Either[A, B]
, provided A
and B
have an implicit CellDecoder in scope.
Turns a cell into an instance of Either[A, B]
, provided A
and B
have an implicit CellDecoder in scope.
This is done by first attempting to parse the cell as an A
. If that fails, we'll try parsing it as a B
. If that
fails as well, DecodeResult.DecodeFailure will be returned.
Turns a cell into a Float
value.
Turns a cell into an Int
value.
Turns a cell into a Long
value.
Turns a cell into an instance of Option[A]
, provided A
has an implicit CellDecoder in scope.
Turns a cell into an instance of Option[A]
, provided A
has an implicit CellDecoder in scope.
Any non-empty string will map to Some
, the empty string to None
.
Turns a cell into a Short
value.
Turns a cell into a String
value.
Turns a cell into a UUID
value.
Defines convenience methods for creating and retrieving instances of CellDecoder.
Implicit default implementations of standard types are also declared here, always bringing them in scope with a low priority.
These default implementations can also be useful when writing more complex instances: if you need to write a
CellDecoder[B]
and have both aCellDecoder[A]
and aA => B
, you need just use CellDecoder.map to create your implementation.