Property without getter in Kotlin -
how can declare property custom setter, without getter in kotlin? in anko example this:
var myproperty: type @deprecated(ankointernals.no_getter, level = deprecationlevel.error) get() = ankointernals.nogetter() set(value) { field = value; /* setter logic */ }
but looks bit hacky me. right way so? if yes, case when project doesn't have anko dependency?
p.s. let me clear - want have no getter @ all, rather private getter
deprecating setter still way effect.
you don't need anko dependency, use @deprecated
annotation appropriate level
.
Comments
Post a Comment