public Observable < ProductDetailsViewState > getDetails ( int productId ) { return getProductWithShoppingCartInfo ( productId ) . subscribeOn ( Schedulers . io ( ) ) . map ( ProductDetailsViewState . DataState :: new ) . cast ( ProductDetailsViewState . class ) . startWith ( new ProductDetailsViewState . LoadingState ( ) ) . onErrorReturn ( ProductDetailsViewState . ErrorState :: new ) ; }
Get the details of a given product