hi there, I am new to kotlin and whether the follo...
# announcements
h
hi there, I am new to kotlin and whether the following code is idiomatic?
Copy code
data class Log(val appUser: String, val timestamp: Long, val event: String, val eventDesc: String) {
    companion object Parser {
        fun parse(line: String): Log {
            val x = line.split(",").subList(0, 4)
            return Log(x[0], DATE_TIME_FORMATTER.parse(x[1]).time / 1000, x[2], x[3])
        }
    }
}
👍 1