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

com.cookingfox.lapasse.api.command.handler.RxSingleMultiCommandHandler Maven / Gradle / Ivy

The newest version!
package com.cookingfox.lapasse.api.command.handler;

import com.cookingfox.lapasse.api.command.Command;
import com.cookingfox.lapasse.api.event.Event;
import com.cookingfox.lapasse.api.state.State;
import rx.Single;

import java.util.Collection;

/**
 * Command handler that returns an Rx Single for a collection of events.
 *
 * @param  The concrete type of the state object.
 * @param  The concrete command type that this handler will handle.
 * @param  The concrete event type that this handler will produce.
 */
public interface RxSingleMultiCommandHandler
        extends MultiCommandHandler {

    /**
     * Handle a command and return an Rx Single.
     *
     * @param state   The current state object.
     * @param command The command object to handle.
     * @return An Rx Single for a collection of events.
     */
    Single> handle(S state, C command);

}