Hello All, old javahead here, is there a more eleg...
# getting-started
v
Hello All, old javahead here, is there a more elegant way in deal with the classic issue of having to double iterate data struictures like : List<MyPojo> when MyPojo also has collection as a property (ex var myProp: List<String> ) ?
c
So you’re looking to just have a single loop over all the pojo’s strings?
pojoList.flatMap { it.myProp }
will get that for you
👍🏽 3
v
hmm, let me experiment with that. I didn’t realize it could work with objects as well
One thing I have been liking about Kotlin is that it’s definitely broadening my realm of known unknowns 🙂
Thanks!