Interface QuoteStateSelectionStrategy

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