Hello. I have this class where I’ve got some prope...
# announcements
u
Hello. I have this class where I’ve got some properties which should act both lazy and observable (so none of delegates suits me). What is the Kotlin-way I can get rid of the boilerplate on
name
and
age
variables?
p
Write your own property delegate.
1
j
I thought lazy applies to
val
only, and observable to
var
only? (I’m new)
u
Okay, the problem is, I use
.properties
file to store these values, but it seems like storing
Properties
value in the object of class itself isn’t that bad. Thanks.
j
Can
lazy
be used with mutable variables?
u
No, it doesn’t provide
setValue
method.