First of all do I think this code is hard to read so I would rethink my options. But you know more since you have the bigger picture. If you really really need to have the code that way, put the logic into a function that handle the logic in get
mikaelquick
07/04/2019, 4:43 PM
Sorry for the bad English
a
Alowaniak
07/04/2019, 6:25 PM
I'm not sure of a good usecase to override the getter? In the given example I would think a factory function would make more sense so you can't create one with empty id
r
rkeazor
07/04/2019, 9:03 PM
lol overriding a getter inside data class doesn't seem to cool lol. perhaps you need a open class or a abstract class instead