carlos bolanos
08/16/2021, 10:21 PMclass Bar {
baz: String
zab: String
}
class Foo {
attributes: Bar()
}
var foo = Foo()
for(attr in foo.atributes) {
println("$attr")
// baz
// zab
}
I’m looking at using kotlin-reflection lib
and when i use this.condiments::class.members
, i can see the attributes with a bunch of metadata, but i cant get the value.
var foo = Foo()
for(attr in foo.atributes::class.members) {
println("$attr")
// baz
// zab
}
Youssef Shoaib [MOD]
08/16/2021, 10:37 PMfor(attr in foo.attributes::class.memberProperties) {
println("${(attr as KProperty1<Bar, Any>).get(foo.attributes)}")
}
carlos bolanos
08/16/2021, 11:14 PM