Class DirectDiscountDraftImpl
- All Implemented Interfaces:
DirectDiscountDraft
,io.vrap.rmf.base.client.Draft<DirectDiscountDraft>
,io.vrap.rmf.base.client.ModelBase
Represents a CartDiscount that can only be associated with a single Cart or Order.
Direct Discounts are always active and valid, and have the default Stacking
StackingMode. They apply in the order in which they are listed in the directDiscounts
array of Carts or Orders, and do not have a sorting order like Cart Discounts.
If a Direct Discount is present, any matching Cart Discounts in the Project are ignored. Additionally, a Cart or Order supports either Discount Codes or Direct Discounts 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Defines what part of the Cart will be discounted.getValue()
Defines the effect the Discount will have.int
hashCode()
void
setTarget
(CartDiscountTarget target) Defines what part of the Cart will be discounted.void
setValue
(CartDiscountValue value) Defines the effect the Discount will have.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.cart.DirectDiscountDraft
withDirectDiscountDraft
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
-
Constructor Details
-
DirectDiscountDraftImpl
public DirectDiscountDraftImpl()create empty instance
-
-
Method Details
-
getValue
Defines the effect the Discount will have.
- Specified by:
getValue
in interfaceDirectDiscountDraft
- Returns:
- value
-
getTarget
Defines what part of the Cart will be discounted.
If
value
is set togiftLineItem
, this must not be set.- Specified by:
getTarget
in interfaceDirectDiscountDraft
- Returns:
- target
-
setValue
Description copied from interface:DirectDiscountDraft
Defines the effect the Discount will have.
- Specified by:
setValue
in interfaceDirectDiscountDraft
- Parameters:
value
- value to be set
-
setTarget
Description copied from interface:DirectDiscountDraft
Defines what part of the Cart will be discounted.
If
value
is set togiftLineItem
, this must not be set.- Specified by:
setTarget
in interfaceDirectDiscountDraft
- Parameters:
target
- value to be set
-
equals
-
hashCode
-