trait CellEncoderInstances extends AnyRef
Ordering
- Alphabetic
- By Inheritance
Inherited
- CellEncoderInstances
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- implicit def cellEncoderOpt[A](implicit arg0: CellEncoder[A]): CellEncoder[Option[A]]
Provides an instance of
CellEncoder[Option[A]]
for any typeA
that has an instance of CellEncoder.Provides an instance of
CellEncoder[Option[A]]
for any typeA
that has an instance of CellEncoder.Some encoding scala> CellEncoder[Option[Int]].encode(Some(123)) res1: String = 123 // None encoding scala> CellEncoder[Option[Int]].encode(None) res2: String = ""
Example: - implicit def eitherCellEncoder[A, B](implicit arg0: CellEncoder[A], arg1: CellEncoder[B]): CellEncoder[Either[A, B]]
Provides an instance of
CellEncoder[Either[A, B]]
for any typeA
andB
that have instances of CellEncoder.Provides an instance of
CellEncoder[Either[A, B]]
for any typeA
andB
that have instances of CellEncoder.// Left encoding scala> CellEncoder[Either[Int, Boolean]].encode(Left(123)) res1: String = 123 // Right encoding scala> CellEncoder[Either[Int, Boolean]].encode(Right(true)) res2: String = true
Example: - implicit def fromStringEncoder[A](implicit arg0: StringEncoder[A]): CellEncoder[A]
Turns existing
StringEncoder
instances into CellEncoder ones.Turns existing
StringEncoder
instances into CellEncoder ones.This provides support for most basic Scala types.
CellEncoder[Int].encode(123) res1: String = 123
Example: