Interface QuoteStateSelectionStrategy
-
- All Known Implementing Classes:
DefaultQuoteStateSelectionStrategy
public interface QuoteStateSelectionStrategyStrategy to help select quote states
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<QuoteAction>getAllowedActionsForState(QuoteState state, UserModel userModel)Provides the list of actions based on the given state.java.util.Set<QuoteState>getAllowedStatesForAction(QuoteAction action, UserModel userModel)Provides the list of quote states based on provided action.java.util.Optional<QuoteState>getTransitionStateForAction(QuoteAction action, UserModel userModel)Provides a quote state that the quote should be in for the corresponding action.
-
-
-
Method Detail
-
getAllowedStatesForAction
java.util.Set<QuoteState> getAllowedStatesForAction(QuoteAction action, UserModel userModel)
Provides the list of quote states based on provided action.- Parameters:
action- quote action that is being performeduserModel- user used to determine the allowed states- Returns:
- Set of quote states associated with the action. Empty set will be returned if none of the states is allowed.
- Throws:
java.lang.IllegalArgumentException- if any of the parameters is null
-
getAllowedActionsForState
java.util.Set<QuoteAction> getAllowedActionsForState(QuoteState state, UserModel userModel)
Provides the list of actions based on the given state.- Parameters:
state- quote state that can allow one actionuserModel- user used to determine the allowed actions- Returns:
- Set of actions allowed by this state. Empty set will be returned if none of the actions is allowed.
- Throws:
java.lang.IllegalArgumentException- if any of the parameters is null
-
getTransitionStateForAction
java.util.Optional<QuoteState> getTransitionStateForAction(QuoteAction action, UserModel userModel)
Provides a quote state that the quote should be in for the corresponding action.- Parameters:
action- quote action that is being performeduserModel- user used to determine the transition state- Returns:
- quote state
- Throws:
java.lang.IllegalArgumentException- if any of the parameters is null
-
-