trait CellDecoderInstances extends AnyRef
Ordering
- Alphabetic
- By Inheritance
Inherited
- CellDecoderInstances
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- implicit def cellDecoderEither[A, B](implicit arg0: CellDecoder[A], arg1: CellDecoder[B]): CellDecoder[Either[A, B]]
Provides an instance of
CellDecoder[Either[A, B]]
for any typeA
andB
that have instances of CellDecoder.Provides an instance of
CellDecoder[Either[A, B]]
for any typeA
andB
that have instances of CellDecoder.// Left value scala> CellDecoder[Either[Int, Boolean]].decode("123") res1: DecodeResult[Either[Int, Boolean]] = Right(Left(123)) // Right value scala> CellDecoder[Either[Int, Boolean]].decode("true") res2: DecodeResult[Either[Int, Boolean]] = Right(Right(true))
Example: - implicit def cellDecoderOpt[A](implicit arg0: CellDecoder[A]): CellDecoder[Option[A]]
Provides an instance of
CellDecoder[Option[A]]
for any typeA
that has an instance of CellDecoder.Provides an instance of
CellDecoder[Option[A]]
for any typeA
that has an instance of CellDecoder.// Non-empty value scala> CellDecoder[Option[Int]].decode("123") res1: DecodeResult[Option[Int]] = Right(Some(123)) // Empty value scala> CellDecoder[Option[Int]].decode("") res2: DecodeResult[Option[Int]] = Right(None)
Example: - implicit def fromStringDecoder[A](implicit arg0: StringDecoder[A]): CellDecoder[A]
Turns existing
StringDecoder
instances into CellDecoder ones.Turns existing
StringDecoder
instances into CellDecoder ones.This provides support for most basic Scala types.
scala> CellDecoder[Int].decode("123") res1: DecodeResult[Int] = Right(123)
Example: