Class CartDiscountSetStoresActionBuilder

java.lang.Object
com.commercetools.api.models.cart_discount.CartDiscountSetStoresActionBuilder
All Implemented Interfaces:
Builder<CartDiscountSetStoresAction>

public class CartDiscountSetStoresActionBuilder extends Object implements Builder<CartDiscountSetStoresAction>
CartDiscountSetStoresActionBuilder
Example to create an instance using the builder pattern

     CartDiscountSetStoresAction cartDiscountSetStoresAction = CartDiscountSetStoresAction.builder()
             .plusStores(storesBuilder -> storesBuilder)
             .build()
 
  • Constructor Details

    • CartDiscountSetStoresActionBuilder

      public CartDiscountSetStoresActionBuilder()
  • Method Details

    • stores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      stores - value to be set
      Returns:
      Builder
    • stores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      stores - value to be set
      Returns:
      Builder
    • plusStores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      stores - value to be set
      Returns:
      Builder
    • plusStores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      builder - function to build the stores value
      Returns:
      Builder
    • withStores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      builder - function to build the stores value
      Returns:
      Builder
    • addStores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      builder - function to build the stores value
      Returns:
      Builder
    • setStores

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      builder - function to build the stores value
      Returns:
      Builder
    • getStores

      public List<StoreResourceIdentifier> getStores()

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Returns:
      stores
    • build

      builds CartDiscountSetStoresAction with checking for non-null required values
      Specified by:
      build in interface Builder<CartDiscountSetStoresAction>
      Returns:
      CartDiscountSetStoresAction
    • buildUnchecked

      public CartDiscountSetStoresAction buildUnchecked()
      builds CartDiscountSetStoresAction without checking for non-null required values
      Returns:
      CartDiscountSetStoresAction
    • of

      factory method for an instance of CartDiscountSetStoresActionBuilder
      Returns:
      builder
    • of

      create builder for CartDiscountSetStoresAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder