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)
}
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.