CsvGenerators

com.phasmidsoftware.tableparser.core.render.CsvGenerators
See theCsvGenerators companion object

The CsvGenerators class provides factory methods for creating CsvGenerator instances for different types of data structures. These generators can be used to serialize data into CSV (Comma-Separated Values) format.

The class includes methods to handle sequences, options, individual types, and products (case classes with varying numbers of fields). It supports up to 6-ary product types, allowing for type inference and customization of CSV behavior.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AttributeSet
object CsvGenerator

Members list

Value members

Concrete methods

def optionGenerator[T](using ca: CsvAttributes): CsvGenerator[Option[T]]

Method to return a CsvGenerator[ Option[T] ].

Method to return a CsvGenerator[ Option[T] ].

Type parameters

T

the underlying type of the first parameter of the input to the render method.

Attributes

Returns

a CsvGenerator[ Option[T] ].

def optionProductGenerator[T](using g: CsvGenerator[T]): CsvGenerator[Option[T]]

Method to return a CsvGenerator[Option[T]] whose columns are those of T. Use this for an optional field whose type has several columns (e.g. a case class), together with CsvRenderers.optionProductRenderer. (optionGenerator gives an Option just one column.)

Method to return a CsvGenerator[Option[T]] whose columns are those of T. Use this for an optional field whose type has several columns (e.g. a case class), together with CsvRenderers.optionProductRenderer. (optionGenerator gives an Option just one column.)

Type parameters

T

the underlying type.

Value parameters

g

the CsvGenerator[T].

Attributes

Returns

a CsvGenerator[Option[T]].

def sequenceGenerator[T](using ca: CsvAttributes): CsvGenerator[Seq[T]]

Method to return a CsvGenerator[ Seq[T] ].

Method to return a CsvGenerator[ Seq[T] ].

Type parameters

T

the underlying type of the first parameter of the input to the render method.

Attributes

Returns

a CsvGenerator[ Seq[T] ]

def skipGenerator[T](using ca: CsvAttributes): CsvGenerator[T]

Method to return a CsvGenerator[T] which does not output a column header for at all.

Method to return a CsvGenerator[T] which does not output a column header for at all.

Type parameters

T

the type of the column objects.

Attributes

Returns

a CsvGenerator[T].

Givens

Givens

given optionBigIntGenerator: CsvGenerator[Option[BigInt]]
given optionBooleanGenerator: CsvGenerator[Option[Boolean]]
given optionByteGenerator: CsvGenerator[Option[Byte]]
given optionDoubleGenerator: CsvGenerator[Option[Double]]
given optionFloatGenerator: CsvGenerator[Option[Float]]
given optionInstantGenerator: CsvGenerator[Option[Instant]]
given optionIntGenerator: CsvGenerator[Option[Int]]
given optionLocalDateGenerator: CsvGenerator[Option[LocalDate]]
given optionLongGenerator: CsvGenerator[Option[Long]]
given optionShortGenerator: CsvGenerator[Option[Short]]
given optionStringGenerator: CsvGenerator[Option[String]]