Package 

Class MaybeUseCase


  • 
    public abstract class MaybeUseCase<ARGS extends Object, T extends Object>
    extends BaseUseCase
                        

    Base use case which wraps Maybe. Instance of this use case can be simply executed in cooperation with app.futured.arkitekt.rxusecases.disposables.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 Summary

      Constructors 
      Constructor Description
      MaybeUseCase()
    • Method Summary

      Modifier and Type Method Description
      final Maybe<T> create(ARGS args) Creates internal Maybe Rx stream, applies requested work & result schedulers and exposes this stream as a Maybe.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MaybeUseCase

        MaybeUseCase()
    • Method Detail

      • create

         final 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) }