package Ġcom . jn fr an 9 2 . kot coin . presentation . crypto . data flow . processor Ċ Ċ import Ġcom . jn fr an 9 2 . domain . crypto . Get Crypto Details UseCase Ċ import Ġcom . jn fr an 9 2 . kot coin . presentation . crypto . data flow . action . Crypto Details Action Ċ import Ġcom . jn fr an 9 2 . kot coin . presentation . crypto . data flow . result . Crypto Details Result Ċ import Ġcom . jn fr an 9 2 . kot coin . presentation . crypto . mapper . Domain Crypto Details To UI Mapper Ċ import Ġio . reactivex . Observable Ċ import Ġio . reactivex . Observable Source Ċ import Ġio . reactivex . Observable Transformer Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ import Ġtim ber . log . Tim ber Ċ import Ġjavax . inject . Inject ĊĊ Ċ class ĠCrypto Details Processor Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġget Crypto Details UseCase : ĠGet Crypto Details UseCase , ĊĠĠĠ Ġprivate Ġval Ġto UI Mapper : ĠDomain Crypto Details To UI Mapper Ċ ) Ġ: ĠObservable Transformer < Crypto Details Action , ĠCrypto Details Result > Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġapply ( upstream : ĠObservable < Crypto Details Action >): ĠObservable Source < Crypto Details Result > Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" apply ") ĊĠĠĠĠĠĠĠ Ġreturn Ġupstream . flatMap Ġ{ Ġaction Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" apply : Ġaction Ġ$ action ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwhen Ġ( action ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠCrypto Details Action . Get Crypto Details Ġ-> Ġbuild Get Crypto Details UseCase ( action . itemId ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġprivate Ġfun Ġbuild Get Crypto Details UseCase ( itemId : ĠLong ): ĠObservable < Crypto Details Result >? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġget Crypto Details UseCase ( itemId ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map ( to UI Mapper :: transform ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Observable () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map ( Crypto Details Result . Get Crypto Details Result :: On Success ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. cast ( Crypto Details Result :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. start With ( Crypto Details Result . Get Crypto Details Result . InProgress ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. onError Return ( Crypto Details Result . Get Crypto Details Result :: OnError ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Schedulers . io ()) ĊĠĠĠ Ġ} Ċ }