Interface StagedOrderSetDirectDiscountsAction
- All Superinterfaces:
ResourceUpdateAction<StagedOrderUpdateAction>
,StagedOrderUpdateAction
Adds a DirectDiscount, but only if no DiscountCode has been added to the Order. Either a Discount Code or a Direct Discount can exist on a Order at the same time.
Example to create an instance using the builder pattern
StagedOrderSetDirectDiscountsAction stagedOrderSetDirectDiscountsAction = StagedOrderSetDirectDiscountsAction.builder()
.plusDiscounts(discountsBuilder -> discountsBuilder)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
discriminator value for StagedOrderSetDirectDiscountsAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for StagedOrderSetDirectDiscountsActionbuilder
(StagedOrderSetDirectDiscountsAction template) create builder for StagedOrderSetDirectDiscountsAction instancedeepCopy
(StagedOrderSetDirectDiscountsAction template) factory method to create a deep copy of StagedOrderSetDirectDiscountsAction@NotNull @Valid List<DirectDiscountDraft>
If set, all existing Direct Discounts are replaced.of()
factory methodof
(StagedOrderSetDirectDiscountsAction template) factory method to create a shallow copy StagedOrderSetDirectDiscountsActionvoid
setDiscounts
(DirectDiscountDraft... discounts) If set, all existing Direct Discounts are replaced.void
setDiscounts
(List<DirectDiscountDraft> discounts) If set, all existing Direct Discounts are replaced.static com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetDirectDiscountsAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
Methods inherited from interface com.commercetools.api.models.order.StagedOrderUpdateAction
getAction, withStagedOrderUpdateAction
-
Field Details
-
SET_DIRECT_DISCOUNTS
discriminator value for StagedOrderSetDirectDiscountsAction- See Also:
-
-
Method Details
-
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 Order are recalculated.
- Returns:
- discounts
-
setDiscounts
- 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 Order are recalculated.
- Parameters:
discounts
- values to be set
-
setDiscounts
- 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 Order are recalculated.
- Parameters:
discounts
- values to be set
-
of
factory method- Returns:
- instance of StagedOrderSetDirectDiscountsAction
-
of
factory method to create a shallow copy StagedOrderSetDirectDiscountsAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static StagedOrderSetDirectDiscountsAction deepCopy(@Nullable StagedOrderSetDirectDiscountsAction template) factory method to create a deep copy of StagedOrderSetDirectDiscountsAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StagedOrderSetDirectDiscountsAction- Returns:
- builder
-
builder
static StagedOrderSetDirectDiscountsActionBuilder builder(StagedOrderSetDirectDiscountsAction template) create builder for StagedOrderSetDirectDiscountsAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStagedOrderSetDirectDiscountsAction
default <T> T withStagedOrderSetDirectDiscountsAction(Function<StagedOrderSetDirectDiscountsAction, 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<StagedOrderSetDirectDiscountsAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-