package easymvp.usecase;

import javax.annotation.Nullable;

import easymvp.executer.PostExecutionThread;
import easymvp.executer.UseCaseExecutor;
import io.reactivex.Maybe;
import io.reactivex.MaybeTransformer;

/**
 * @author Saeed Masoumi (s-masoumi@live.com)
 */

public abstract class MaybeUseCase<R, Q> extends UseCase<Maybe, Q> {
    private final MaybeTransformer<? super R, ? extends R> schedulersTransformer;

    public MaybeUseCase(final UseCaseExecutor useCaseExecutor,
                        final PostExecutionThread postExecutionThread) {
        super(useCaseExecutor, postExecutionThread);
        schedulersTransformer = new MaybeTransformer<R, R>() {
            @Override
            public Maybe<R> apply(Maybe<R> single) {
                return single.subscribeOn(useCaseExecutor.getScheduler())
                        .observeOn(postExecutionThread.getScheduler());
            }
        };
    }

    @Override
    public Maybe execute(@Nullable Q param) {
        return interact(param).compose(getSchedulersTransformer());
    }

    @Override
    protected abstract Maybe<R> interact(@Nullable Q param);

    private MaybeTransformer<? super R, ? extends R> getSchedulersTransformer() {
        return schedulersTransformer;
    }
}

@@ -260,17 +260,16 @@
 om)%0A */%0A
-%0A
 public a
@@ -947,16 +947,19 @@
 ic Maybe
+%3CR%3E
  execute

Fix return type of Maybe usecase