A General Converter is a wrapper for a function (String)=>T
This function is used by the CsvParser to parse fields of type T
There are several default converters defined or you can make your own
and make them available as implict parameters.
The reason we use a wrapper is to avoid any old (String)=>T function
being selected by mistake. If you made a GeneralConverter then you
almost certainly intended that the parser use it to convert type T.
Example:
implicitobject ymd extends GeneralConverter[java.util.Date]{
val f= new java.text.SimpleDateFormat("yy-MM-dd")
def convert(x:String)=f.parse(x.trim)
}
This member is added by an implicit conversion from GeneralConverter[A] to
any2stringadd[GeneralConverter[A]] performed by method any2stringadd in scala.Predef.
This member is added by an implicit conversion from GeneralConverter[A] to
ArrowAssoc[GeneralConverter[A]] performed by method ArrowAssoc in scala.Predef.
This member is added by an implicit conversion from GeneralConverter[A] to
StringFormat[GeneralConverter[A]] performed by method StringFormat in scala.Predef.
This member is added by an implicit conversion from GeneralConverter[A] to
ArrowAssoc[GeneralConverter[A]] performed by method ArrowAssoc in scala.Predef.
A General Converter is a wrapper for a function (String)=>T
This function is used by the CsvParser to parse fields of type T
There are several default converters defined or you can make your own and make them available as implict parameters.
The reason we use a wrapper is to avoid any old (String)=>T function being selected by mistake. If you made a GeneralConverter then you almost certainly intended that the parser use it to convert type T.
Example:
Note: the above example is a bit contrived because a pre-existing DateConverter class exists. See the com.github.marklister.collections.io.DateConverter docs.