object AccessLog { case class Entry(clientIp: String, userId: String, timestamp: Instant, path: String, statusCode: Int) def parseLine(line: String): Entry = line.split(",") match { case Array(clientIp, userId, timestamp, path, statusCode) => Entry(clientIp, userId, new Instant(timestamp), path, statusCode.toInt) } }