Class CartDiscountAddStoreActionBuilder

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

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

     CartDiscountAddStoreAction cartDiscountAddStoreAction = CartDiscountAddStoreAction.builder()
             .store(storeBuilder -> storeBuilder)
             .build()
 
  • Constructor Details

    • CartDiscountAddStoreActionBuilder

      public CartDiscountAddStoreActionBuilder()
  • Method Details

    • store

      Store to add.

      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 store value
      Returns:
      Builder
    • withStore

      Store to add.

      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 store value
      Returns:
      Builder
    • store

      Store to add.

      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:
      store - value to be set
      Returns:
      Builder
    • getStore

      public StoreResourceIdentifier getStore()

      Store to add.

      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:
      store
    • build

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

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

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

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