ProductCsvProduct

com.phasmidsoftware.tableparser.core.render.ProductCsvProduct
class ProductCsvProduct[T](fieldNames: List[String], fieldRenderers: List[CsvRenderer[_]], fieldGenerators: List[CsvGenerator[_]])(using ca: CsvAttributes, helper: ColumnHelper[T]) extends ProductCsvGenerator[T], BaseCsvRenderer[T], CsvProduct[T]

The CsvProduct of a case class T, as derived by CsvProduct.derived: a ProductCsvGenerator which is also a CsvRenderer.

Type parameters

T

the type of the case class.

Value parameters

ca

the CsvAttributes.

fieldGenerators

the CsvGenerators of the fields of T, in the same order.

fieldNames

the names of the fields of T, in declaration order.

fieldRenderers

the CsvRenderers of the fields of T, in the same order.

helper

the ColumnHelper[T].

Attributes

Graph
Supertypes
trait CsvProduct[T]
trait BaseCsvRenderer[T]
trait CsvRenderer[T]
trait Renderer[T, String]
trait CsvGenerator[T]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def elements(t: T): Strings

Method to obtain a Seq of Strings corresponding to each of the members of the given value of t.

Method to obtain a Seq of Strings corresponding to each of the members of the given value of t.

Value parameters

t

an instance of type T.

Attributes

Returns

a Strings, i.e. a Seq[String].

Inherited methods

def merge(po: Option[String], no: Option[String]): Option[String]

Merges two optional strings into a single optional string. If both po and no are defined, the resulting string is their concatenation in the format po.no. If only one of the options is defined, it returns that single option. If neither are defined, it returns None.

Merges two optional strings into a single optional string. If both po and no are defined, the resulting string is their concatenation in the format po.no. If only one of the options is defined, it returns that single option. If neither are defined, it returns None.

Value parameters

no

an optional suffix string; if defined, it will form the second part of the resulting string.

po

an optional prefix string; if defined, it will form the first part of the resulting string.

Attributes

Returns

an optional string in the format po.no if both options are defined, or the defined option if only one is present, or None if both are None.

Inherited from:
StandardCsvGenerator
def render(t: T, attrs: Map[String, String]): String

Concrete method to render t as a single String, where the columns are delimited according to csvAttributes.delimiter.

Concrete method to render t as a single String, where the columns are delimited according to csvAttributes.delimiter.

Value parameters

attrs

a map of attributes for this value of O.

t

the input parameter, i.e., the T object to render.

Attributes

Returns

an instance of type String.

Inherited from:
BaseCsvRenderer
def render(t: T): String

Render an instance of T as an O, qualifying the rendering with no attributes.

Render an instance of T as an O, qualifying the rendering with no attributes.

Value parameters

t

a T to be rendered.

Attributes

Returns

an instance of type O.

Inherited from:
Renderer
override def toColumnName(po: Option[String], name: String): String

Converts the given optional parent name and column name into a single formatted column name.

Converts the given optional parent name and column name into a single formatted column name.

Value parameters

name

The name of the base column to be formatted.

po

An optional string representing the parent column or prefix, which may be used to create a nested or hierarchical column name.

Attributes

Returns

A formatted string representing the column name, typically following the pattern "parent.column", if a parent name is provided.

Definition Classes
Inherited from:
CsvProductGenerator
def toColumnNames(po: Option[String], no: Option[String]): String

Method to generate the column names of the fields of T. The name of the enclosing field (if any) is no (or po, if that is all there is): each field's column name is then helper.lookup(that name, field name), as in CellParser.derived. A field which is itself a case class is given its column name as the name of its enclosing field.

Method to generate the column names of the fields of T. The name of the enclosing field (if any) is no (or po, if that is all there is): each field's column name is then helper.lookup(that name, field name), as in CellParser.derived. A field which is itself a case class is given its column name as the name of its enclosing field.

Attributes

Inherited from:
ProductCsvGenerator

Inherited fields

Attributes

Inherited from:
StandardCsvGenerator