The standard way to write the equivalent of static Java methods in Scala is to add this method to an object of the companion class. So:
case class At (
date : DateTime,
id : String,
location : Coordinate
)
object At
{
...
def getParsedValues(line : String) : At =
{
val mappedFields : Array[String] = Utils.splitFields(line)
val atObject = new At(mappedFields)
return atObject;
}
...
}
Then call it, as you already do in your Readerobject.
, , , , , Array[String], factory . "" new. , atObject return atObject - . , :
def getParsedValues(line: String): At = At(Utils.splitFields(line))