Is there a way to rename the default getters and setters in Kotlin? I have a property named in snake_case
, but I still want the getters and setters to be named in camelCase
.
The closest I've gotten is something like
private var property_name = Color.BLACK
private set
fun setPropertyName(c: Color) { property_name = c }
fun getPropertyName() = property_name
Is there a way to do this without hiding the getters and setters and defining new methods?