ConditionalCellParser

com.phasmidsoftware.tableparser.core.parse.ConditionalCellParser
class ConditionalCellParser[K, P, T](typeName: String, fields: List[String], construct: (K, P) => T, parsers: Map[K, CellParser[P]])(using kp: CellParser[K], helper: ColumnHelper[T]) extends MultiCellParser[T]

The CellParser made by CellParsers.cellParser2Conditional.

Type parameters

K

the type of the first field of T.

P

the type of the second field of T.

T

the type of the result.

Value parameters

construct

a function (K,P) => T.

fields

the names of the two fields of T.

parsers

the parser of P to use for each value of K.

typeName

the name of T (used in error messages).

Attributes

Graph
Supertypes
trait MultiCellParser[T]
trait CellParser[T]
trait StringConverter[T]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def parse(wo: Option[String], row: Row, columns: Header): Try[T]

Method to parse an Option[String] to a T.

Method to parse an Option[String] to a T.

Value parameters

columns

the column names. CONSIDER do we actually need the Header parameter here?

row

a Row of values.

wo

an optional String.

Attributes

Returns

a new instance of T.

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes

Inherited methods

def convertString(w: String): Try[T]

Convert a String into a T.

Convert a String into a T.

Value parameters

w

the String to be converted.

Attributes

Returns

a new instance of T wrapped in Try

Inherited from:
MultiCellParser
def parse(value: Convertible): Try[T]

Parse a Convertible value into a T.

Parse a Convertible value into a T.

Value parameters

value

the Convertible value.

Attributes

Returns

a new instance of T wrapped in Try.

Inherited from:
CellParser