Provides an instance of CellDecoder[Either[A, B]] for any type A and B that have instances of
CellDecoder.
Provides an instance of CellDecoder[Either[A, B]] for any type A and B that have instances of
CellDecoder.
Strings that can be decoded as the first type are returned as Left:
scala> CellDecoder[Either[Int, Boolean]].decode("123") res1: DecodeResult[Either[Int, Boolean]] = Success(Left(123))
Strings that cannot be decoded as the first type, but can as the second, are returned as Right:
scala> CellDecoder[Either[Int, Boolean]].decode("true") res2: DecodeResult[Either[Int, Boolean]] = Success(Right(true))
Provides an instance of CellDecoder[Option[A]] for any type A that has an instance of CellDecoder.
Provides an instance of CellDecoder[Option[A]] for any type A that has an instance of CellDecoder.
Non-empty strings are decoded as Some:
scala> CellDecoder[Option[Int]].decode("123") res1: DecodeResult[Option[Int]] = Success(Some(123))
Empty strings are decoded as None:
scala> CellDecoder[Option[Int]].decode("") res1: DecodeResult[Option[Int]] = Success(None)
Turns existing StringDecoder instances into CellDecoder ones.
Turns existing StringDecoder instances into CellDecoder ones.
This provides support for most basic Scala types - Int, for example:
CellDecoder[Int].decode("123") res1: DecodeResult[Option[Int]] = Success(Some(123))
All default CellDecoder instances.