Package moxy.viewstate.strategy
Class OneExecutionStateStrategy
- java.lang.Object
-
- moxy.viewstate.strategy.OneExecutionStateStrategy
-
- All Implemented Interfaces:
StateStrategy
public class OneExecutionStateStrategy extends java.lang.Object implements StateStrategy
Command will be saved in the commands queue, but will be removed after its first execution.
-
-
Constructor Summary
Constructors Constructor Description OneExecutionStateStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <View extends MvpView>
voidafterApply(java.util.List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand)Called immediately after a command was applied to anMvpView.<View extends MvpView>
voidbeforeApply(java.util.List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand)Called immediately afterMvpViewStatereceives some command.
-
-
-
Method Detail
-
beforeApply
public <View extends MvpView> void beforeApply(java.util.List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand)
Description copied from interface:StateStrategyCalled immediately afterMvpViewStatereceives some command. Will not be called before re-apply to some otherMvpView- Specified by:
beforeApplyin interfaceStateStrategy- Type Parameters:
View- type of the given view- Parameters:
currentState- current state ofMvpViewState. EachViewCommandcontains its own parameters.incomingCommand- command for applying to aMvpViewThisViewCommandcontains params of this command.
-
afterApply
public <View extends MvpView> void afterApply(java.util.List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand)
Description copied from interface:StateStrategyCalled immediately after a command was applied to anMvpView. Also called after re-apply to other views.- Specified by:
afterApplyin interfaceStateStrategy- Type Parameters:
View- type of the given view- Parameters:
currentState- current state ofMvpViewState. EachViewCommandcontains its own parameters.incomingCommand- applied command toMvpViewThisViewCommandcontains params of this command.
-
-