Interface QuoteStateSelectionStrategy
- All Known Implementing Classes:
DefaultQuoteStateSelectionStrategy
public interface QuoteStateSelectionStrategy
Strategy to help select quote states
-
Method Summary
Modifier and TypeMethodDescriptiongetAllowedActionsForState(QuoteState state, UserModel userModel) Provides the list of actions based on the given state.getAllowedStatesForAction(QuoteAction action, UserModel userModel) Provides the list of quote states based on provided action.getTransitionStateForAction(QuoteAction action, UserModel userModel) Provides a quote state that the quote should be in for the corresponding action.
-
Method Details
-
getAllowedStatesForAction
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:
IllegalArgumentException- if any of the parameters is null
-
getAllowedActionsForState
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:
IllegalArgumentException- if any of the parameters is null
-
getTransitionStateForAction
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:
IllegalArgumentException- if any of the parameters is null
-