Unwrapping nested objects

To unwrap a nested structure of the tree class, we will use a simple .map() call:

yahooService.yqlQuery(query, env)
.subscribeOn(Schedulers.io())
.map(r -> r.getQuery().getResults().getQuote())

This .map() call will transform all YahooStockResult (because it is what YahooService returns) objects into List<YahooStockQuote> (as it is the result of .getQuote()).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.77.153