Each data class object has a component for each property like component1, component2, etc.. I was wondering if there is any way in Kotlin to iterate over each component of a class. Say I have class:
data class User(age:Int, name:String)
Could I do something like:
for(component in aUserObject){
//do some stuff with age or name
}
?