Interface CartFreezeCartAction

All Superinterfaces:
CartUpdateAction, ResourceUpdateAction<CartUpdateAction>

public interface CartFreezeCartAction extends CartUpdateAction

Freezes the Cart based on the provided FreezeStrategy.

The following behavior occurs:

  • Changes the Cart State from Active to Frozen.
  • Sets the corresponding FreezeStrategy on the Cart's freezeStrategy field.
  • Produces the CartFrozen Message.

If the Cart is empty, an InvalidOperation error is returned.


Example to create an instance using the builder pattern

     CartFreezeCartAction cartFreezeCartAction = CartFreezeCartAction.builder()
             .build()
 
  • Field Details

  • Method Details

    • getStrategy

      FreezeStrategy getStrategy()

      Strategy that determines the freezing behavior.

      Returns:
      strategy
    • setStrategy

      void setStrategy(FreezeStrategy strategy)

      Strategy that determines the freezing behavior.

      Parameters:
      strategy - value to be set
    • of

      static CartFreezeCartAction of()
      factory method
      Returns:
      instance of CartFreezeCartAction
    • of

      factory method to create a shallow copy CartFreezeCartAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface CartUpdateAction
    • deepCopy

      @Nullable static CartFreezeCartAction deepCopy(@Nullable CartFreezeCartAction template)
      factory method to create a deep copy of CartFreezeCartAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static CartFreezeCartActionBuilder builder()
      builder factory method for CartFreezeCartAction
      Returns:
      builder
    • builder

      create builder for CartFreezeCartAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartFreezeCartAction

      default <T> T withCartFreezeCartAction(Function<CartFreezeCartAction,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<CartFreezeCartAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference