Class SingleStateStrategy

  • All Implemented Interfaces:
    StateStrategy

    public class SingleStateStrategy
    extends java.lang.Object
    implements StateStrategy
    This strategy will clear current commands queue and then the given command will be put in.

    Caution! Be sure that you fully set view to initial state inside this command.

    • Constructor Detail

      • SingleStateStrategy

        public SingleStateStrategy()
    • Method Detail

      • afterApply

        public <View extends MvpView> void afterApply​(java.util.List<ViewCommand<View>> currentState,
                                                      ViewCommand<View> incomingCommand)
        Description copied from interface: StateStrategy
        Called immediately after a command was applied to an MvpView. Also called after re-apply to other views.
        Specified by:
        afterApply in interface StateStrategy
        Type Parameters:
        View - type of the given view
        Parameters:
        currentState - current state of MvpViewState. Each ViewCommand contains its own parameters.
        incomingCommand - applied command to MvpView This ViewCommand contains params of this command.