vendredi 28 mai 2021

Listing all the properties in a Kotlin class excluding the ones with custom getters

Is there any simple way to list all the properties in a class excluding the ones with custom getters?

For example in this case:

class Person(val name: String, val age: Int) {

    val signature: String get() = "$name - $age"
    
    val uuid = UUID.randomUUID()
}

I would like to find: [ Person::name, Person::age, Person::uuid ].





Aucun commentaire:

Enregistrer un commentaire