Interface QuoteStateSelectionStrategy

All Known Implementing Classes:
DefaultQuoteStateSelectionStrategy

public interface QuoteStateSelectionStrategy
Strategy to help select quote states
  • Method Details

    • getAllowedStatesForAction

      Set<QuoteState> getAllowedStatesForAction(QuoteAction action, UserModel userModel)
      Provides the list of quote states based on provided action.
      Parameters:
      action - quote action that is being performed
      userModel - 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

      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 action
      userModel - 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

      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 performed
      userModel - user used to determine the transition state
      Returns:
      quote state
      Throws:
      IllegalArgumentException - if any of the parameters is null