Is it possible to create setters automatically that return this
?
Tried following, but this way it's not working, but this example shows what I want to achieve:
var pos: Int?
set(value) : IPosItem {
this.pos = value
return this
}
manual solution
Write setters
and getters
myself of coure, like following:
var _pos: Int?
fun getPos(): Int? = _pos
fun setPos(value: Int?): IPosItem {
_pos = value
return this
}
Question
Can this process be automated with kotlin? Any ideas how to achieve this?