info.fingo.spata.Record.Field
Intermediary to delegate parsing to in order to infer type of formatter used by parser. Provides exception-free parsing method.
Type parameters
-
A
-
target type for parsing
Attributes
-
Graph
-
-
Supertypes
-
class Object
trait Matchable
class Any
Members list
Safely parses string to desired type based on provided format.
Safely parses string to desired type based on provided format.
If wrong header key is provided this function will return Left[error.HeaderError,?]
. If parsing fails Left[error.DataError,?]
will be returned.
Type parameters
-
B
-
type of formatter
Value parameters
-
fmt
-
formatter specific for particular result type, e.g. DateTimeFormatter
for dates and times
-
key
-
the name of retrieved field
-
parser
-
the parser for specific target type
Attributes
-
Returns
-
either parsed value or an error
Safely parses string to desired type based on provided format.
Safely parses string to desired type based on provided format.
If wrong index is provided this function will return Left[error.IndexError,?]
. If parsing fails Left[error.DataError,?]
will be returned.
Type parameters
-
B
-
type of formatter
Value parameters
-
fmt
-
formatter specific for particular result type, e.g. DateTimeFormatter
for dates and times
-
idx
-
the index of retrieved field
-
parser
-
the parser for specific target type
Attributes
-
Returns
-
either parsed value or an error