public class MaybeUseCase<ARGS,T> extends BaseUseCase
Base use case which wraps Maybe. Instance of this
use case can be simply executed in cooperation with
interface MaybeDisposablesOwner interface.
Wrapped stream is subscribed on io.reactivex.schedulers.Schedulers.io and
observed on io.reactivex.android.schedulers.AndroidSchedulers.mainThread
by default. You may override these through workScheduler and
resultScheduler respectively.
| Constructor and Description |
|---|
MaybeUseCase()
Base use case which wraps Maybe. Instance of this
use case can be simply executed in cooperation with
interface MaybeDisposablesOwner interface. |
| Modifier and Type | Method and Description |
|---|---|
io.reactivex.Maybe<T> |
create(ARGS args)
Creates internal Maybe Rx stream, applies requested work
& result schedulers and exposes this stream as a Maybe. This method
is handy when you want to combine streams of multiple use cases.
For example:
|
protected io.reactivex.Maybe<T> |
prepare(ARGS args)
Prepares whole wrapped Maybe Rx stream. This method does not
subscribe to the stream.
|
getResultScheduler, getWorkSchedulerpublic MaybeUseCase()
Base use case which wraps Maybe. Instance of this
use case can be simply executed in cooperation with
interface MaybeDisposablesOwner interface.
Wrapped stream is subscribed on io.reactivex.schedulers.Schedulers.io and
observed on io.reactivex.android.schedulers.AndroidSchedulers.mainThread
by default. You may override these through workScheduler and
resultScheduler respectively.
@NotNull protected io.reactivex.Maybe<T> prepare(ARGS args)
Prepares whole wrapped Maybe Rx stream. This method does not subscribe to the stream.
@NotNull public io.reactivex.Maybe<T> create(ARGS args)
Creates internal Maybe Rx stream, applies requested work & result schedulers and exposes this stream as a Maybe. This method is handy when you want to combine streams of multiple use cases. For example:
usecase_A.create(Unit).flatMap { usecase_B.create(Unit) }