rdgoite
07/15/2019, 2:32 PMget()
is called. However, I just found out that defining something like,
var myCollection: MutableList<String> = mutableListOf()
private set
get() = field.toMutableList()
is problematic because calling this.myCollection
within the class itself seem to call the getter instead. My current alternative is to make it immutable collection and replace it every time there are changes. However, that seems to be a little more work than it should be. Any ideas?Shawn
07/15/2019, 2:34 PMprivate val _list = mutableListOf<Any>()
public val list: List<Any>
private set
get() = _list
rdgoite
07/15/2019, 2:50 PM