jeggy
11/05/2020, 10:31 PMtoString
function on data classes? Can be with annotation or anything. I want to achieve something like this: https://pl.kotl.in/Ld0EBnHM1nanodeath
11/05/2020, 10:35 PMJavier
11/05/2020, 10:49 PMVampire
11/05/2020, 11:22 PMcopy
for example if that is what you want:
data class MyData private constructor(
val value1: String,
val value3: String
) {
private lateinit var value2: String
constructor(
value1: String,
value2: String,
value3: String
) : this(value1, value3) {
this.value2 = value2
}
}
Nir
11/05/2020, 11:47 PMjeggy
11/05/2020, 11:47 PMNir
11/05/2020, 11:48 PMdata class MyData constructor(
val value1: String,
value2: String,
val value3: String
) {
val value2 = value2
}
which Kotlin doesn't actually allowNir
11/05/2020, 11:48 PMnanodeath
11/06/2020, 12:01 AMNir
11/06/2020, 12:50 AMNir
11/06/2020, 12:51 AMnanodeath
11/06/2020, 1:15 AM