Assume I have a data class:
data class SensorData(val name: String, val temp : Double)
I create this SensorData
object from either an REST service or by internal setter method, whereas name
is always populated and temp
might be empty.
Further on, I need this SensorData object through several classes, thats I thought of using a singleton
.
Obviously I need object
keyword as described here, but how can I combine data class object
?