I have a list of objects A, A has a property called Address, which has a street name - streetName
From the list of objects A I want to get a list of all street names. One level assembly seems quite feasible from threads, but how can I get a nested string using a single line of code.
So, to get the address list from object A, I can do this:
listOfObjectsA.stream().map(a::getAddress).collect(Collectors.toList());
My ultimate goal is to get a list of street names, so I cannot find a second level collection using lambda.
I could not find the exact example I was looking for. Can someone please help me with this.
source share