O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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()).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required