Class CartSetDirectDiscountsActionImpl
java.lang.Object
com.commercetools.api.models.cart.CartSetDirectDiscountsActionImpl
- All Implemented Interfaces:
CartSetDirectDiscountsAction
,CartUpdateAction
,ResourceUpdateAction<CartUpdateAction>
,io.vrap.rmf.base.client.ModelBase
public class CartSetDirectDiscountsActionImpl
extends Object
implements CartSetDirectDiscountsAction, io.vrap.rmf.base.client.ModelBase
Adds a DirectDiscount, but only if no DiscountCode has been added to the Cart. Either a Discount Code or a Direct Discount can exist on a Cart at the same time.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Field Summary
Fields inherited from interface com.commercetools.api.models.cart.CartSetDirectDiscountsAction
SET_DIRECT_DISCOUNTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
If set, all existing Direct Discounts are replaced.int
hashCode()
void
setDiscounts
(DirectDiscountDraft... discounts) If set, all existing Direct Discounts are replaced.void
setDiscounts
(List<DirectDiscountDraft> discounts) If set, all existing Direct Discounts are replaced.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.cart.CartSetDirectDiscountsAction
withCartSetDirectDiscountsAction
Methods inherited from interface com.commercetools.api.models.cart.CartUpdateAction
withCartUpdateAction
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Constructor Details
-
CartSetDirectDiscountsActionImpl
public CartSetDirectDiscountsActionImpl()create empty instance
-
-
Method Details
-
getAction
- Specified by:
getAction
in interfaceCartUpdateAction
- Specified by:
getAction
in interfaceResourceUpdateAction<CartUpdateAction>
- Returns:
- action
-
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.
- Specified by:
getDiscounts
in interfaceCartSetDirectDiscountsAction
- Returns:
- discounts
-
setDiscounts
Description copied from interface:CartSetDirectDiscountsAction
- 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.
- Specified by:
setDiscounts
in interfaceCartSetDirectDiscountsAction
- Parameters:
discounts
- values to be set
-
setDiscounts
Description copied from interface:CartSetDirectDiscountsAction
- 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.
- Specified by:
setDiscounts
in interfaceCartSetDirectDiscountsAction
- Parameters:
discounts
- values to be set
-
equals
-
hashCode
public int hashCode()
-