Class CartSetDirectDiscountsActionBuilder
java.lang.Object
com.commercetools.api.models.cart.CartSetDirectDiscountsActionBuilder
- All Implemented Interfaces:
Builder<CartSetDirectDiscountsAction>
public class CartSetDirectDiscountsActionBuilder
extends Object
implements Builder<CartSetDirectDiscountsAction>
CartSetDirectDiscountsActionBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CartSetDirectDiscountsAction cartSetDirectDiscountsAction = CartSetDirectDiscountsAction.builder()
.plusDiscounts(discountsBuilder -> discountsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf set, all existing Direct Discounts are replaced.build()
builds CartSetDirectDiscountsAction with checking for non-null required valuesbuilds CartSetDirectDiscountsAction without checking for non-null required valuesdiscounts
(DirectDiscountDraft... discounts) If set, all existing Direct Discounts are replaced.discounts
(List<DirectDiscountDraft> discounts) If set, all existing Direct Discounts are replaced.If set, all existing Direct Discounts are replaced.of()
factory method for an instance of CartSetDirectDiscountsActionBuilderof
(CartSetDirectDiscountsAction template) create builder for CartSetDirectDiscountsAction instanceplusDiscounts
(DirectDiscountDraft... discounts) If set, all existing Direct Discounts are replaced.If set, all existing Direct Discounts are replaced.If set, all existing Direct Discounts are replaced.If set, all existing Direct Discounts are replaced.
-
Constructor Details
-
CartSetDirectDiscountsActionBuilder
public CartSetDirectDiscountsActionBuilder()
-
-
Method Details
-
discounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
discounts
- value to be set- Returns:
- Builder
-
discounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
discounts
- value to be set- Returns:
- Builder
-
plusDiscounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
discounts
- value to be set- Returns:
- Builder
-
plusDiscounts
public CartSetDirectDiscountsActionBuilder plusDiscounts(Function<DirectDiscountDraftBuilder, DirectDiscountDraftBuilder> builder) - If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
builder
- function to build the discounts value- Returns:
- Builder
-
withDiscounts
public CartSetDirectDiscountsActionBuilder withDiscounts(Function<DirectDiscountDraftBuilder, DirectDiscountDraftBuilder> builder) - If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
builder
- function to build the discounts value- Returns:
- Builder
-
addDiscounts
public CartSetDirectDiscountsActionBuilder addDiscounts(Function<DirectDiscountDraftBuilder, DirectDiscountDraft> builder) - If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
builder
- function to build the discounts value- Returns:
- Builder
-
setDiscounts
public CartSetDirectDiscountsActionBuilder setDiscounts(Function<DirectDiscountDraftBuilder, DirectDiscountDraft> builder) - If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
builder
- function to build the discounts value- Returns:
- Builder
-
getDiscounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Returns:
- discounts
-
build
builds CartSetDirectDiscountsAction with checking for non-null required values- Specified by:
build
in interfaceBuilder<CartSetDirectDiscountsAction>
- Returns:
- CartSetDirectDiscountsAction
-
buildUnchecked
builds CartSetDirectDiscountsAction without checking for non-null required values- Returns:
- CartSetDirectDiscountsAction
-
of
factory method for an instance of CartSetDirectDiscountsActionBuilder- Returns:
- builder
-
of
create builder for CartSetDirectDiscountsAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-