KamilH
10/16/2020, 8:06 AMdata class
with its default values?
For example I have:
data class User(
val id: String,
val deviceId: String
)
and plugin will generate:
fun userOf(
id: String = "",
deviceId: String = "",
): User =
User(
userId = userId,
deviceId = deviceId,
)
or something similar? (Sorry if wrong channel)Milan Hruban
10/16/2020, 8:11 AMdata class User(
val id: String = "",
val deviceId: String = ""
)
KamilH
10/16/2020, 8:14 AMInt
then 0, etc 🙂
Yea, sure default values in constructor is always an option, but those functions I’m using in unit tests and I wouldn’t like to write default values because of correctness of using them in app (it would be easy to forget to initialize some value, because IDE would allow for it)renatomrcosta
10/16/2020, 8:33 AMKamilH
10/16/2020, 8:35 AM