The high level problem I'm trying to solve is transforming a list of Foo objects contained in a fetched FooContainer (Observable) to a list of FooBar objects using RxJava.
My (confused) attempt:
fooContainerObservable
.map(container -> container.getFooList())
.flatMap(foo -> transformFooToFooBar(foo))
.collect( /* What do I do here? Is collect the correct thing? Should I be using lift? */)
.subscribe(fooBarList -> /* Display the list */);
My confusion (or at least one point of it) is the step moving the flattened list back to a list.
Note: I'm attempting to do this in an Android app.
collect? If you want to collect all items to a List, just calltoList.toListexisted. If you answer suggesting that, I'll mark it as the solution!