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
Example to create an instance using the builder pattern
CartDiscountAddStoreAction cartDiscountAddStoreAction = CartDiscountAddStoreAction.builder()
.store(storeBuilder -> storeBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CartDiscountAddStoreAction with checking for non-null required valuesbuilds CartDiscountAddStoreAction without checking for non-null required valuesgetStore()
Store to add.of()
factory method for an instance of CartDiscountAddStoreActionBuilderof
(CartDiscountAddStoreAction template) create builder for CartDiscountAddStoreAction instancestore
(StoreResourceIdentifier store) Store to add.Store to add.Store to add.
-
Constructor Details
-
CartDiscountAddStoreActionBuilder
public CartDiscountAddStoreActionBuilder()
-
-
Method Details
-
store
public CartDiscountAddStoreActionBuilder store(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifierBuilder> builder) 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
public CartDiscountAddStoreActionBuilder withStore(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifier> builder) 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
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 interfaceBuilder<CartDiscountAddStoreAction>
- Returns:
- 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
-