All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cookingfox.lapasse.impl.facade.LaPasseRxFacadeDelegate Maven / Gradle / Ivy

There is a newer version: 0.5.6
Show newest version
package com.cookingfox.lapasse.impl.facade;

import com.cookingfox.lapasse.api.facade.RxFacade;
import com.cookingfox.lapasse.api.state.State;
import com.cookingfox.lapasse.api.state.observer.StateChanged;
import rx.Observable;
import rx.Scheduler;

/**
 * Delegates all {@link RxFacade} operations to a provided instance.
 */
public class LaPasseRxFacadeDelegate
        extends LaPasseFacadeDelegate
        implements RxFacade {

    /**
     * The Rx facade instance to use as delegate.
     */
    protected final RxFacade rxFacade;

    //----------------------------------------------------------------------------------------------
    // CONSTRUCTOR
    //----------------------------------------------------------------------------------------------

    public LaPasseRxFacadeDelegate(RxFacade facade) {
        super(facade);

        rxFacade = facade;
    }

    //----------------------------------------------------------------------------------------------
    // PUBLIC METHODS
    //----------------------------------------------------------------------------------------------

    @Override
    public Observable> observeStateChanges() {
        return rxFacade.observeStateChanges();
    }

    @Override
    public void setCommandObserveScheduler(Scheduler observeOnScheduler) {
        rxFacade.setCommandObserveScheduler(observeOnScheduler);
    }

    @Override
    public void setCommandSubscribeScheduler(Scheduler subscribeOnScheduler) {
        rxFacade.setCommandSubscribeScheduler(subscribeOnScheduler);
    }

}