bodiam
09/01/2021, 12:32 PMlateinit var childFolder1 : FolderNode
lateinit var childFolder2 : FolderNode
val rootFolder = buildFolders(am,"System") {
childFolder1 = folder("A") {
+entry(Attribute("x"), Sample("1"))
}
childFolder2 = folder("A") {
+entry(Attribute("x"), Sample("2"))
+entry(Attribute("x"), Sample("2"))
}
+childFolder1
+childFolder2
}
println(childFolder1) // simplified here
As you can see, I need a reference to childFolder1 in my code, but my current solution seems a bit non-idiomatic, so I was wondering if you have any suggestions on how to improve this?
(I’m also not sure if this is the right channel, the new setup confuses me a bit, so if I need to post this somewhere else, please let me know)
Posted in #codereview