In kotlin, how to make the setter of properties in primary constructor private?
class City(val id: String, var name: String, var description: String = "") {
fun update(name: String, description: String? = "") {
this.name = name
this.description = description ?: this.description
}
}
I want the setter of properties name
to be private, and the getter of it public, how can I do?