Class CartDiscountImpl
- All Implemented Interfaces:
CartDiscount
,CartDiscountMixin
,BaseResource
,Customizable<CartDiscount>
,DomainResource<CartDiscount>
,Identifiable<CartDiscount>
,Referencable<CartDiscount>
,ResourceIdentifiable<CartDiscount>
,Versioned<CartDiscount>
,WithKey
,io.vrap.rmf.base.client.ModelBase
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Valid Cart Predicate.Date and time (UTC) for the CartDiscount was initially created.Present on resources created after 1 February 2019 except for events not tracked.Custom Fields of the CartDiscount.Description of the CartDiscount.getId()
Unique identifier of the CartDiscount.Indicates if the CartDiscount is active and can be applied to the Cart.getKey()
User-defined unique identifier of the CartDiscount.Date and time (UTC) for the CartDiscount was last updated.Present on resources updated after 1 February 2019 except for events not tracked.getName()
Name of the CartDiscount.References of all resources that are addressed in the predicate.Indicates if the Discount is used in connection with a DiscountCode.Value between0
and1
.Indicates whether the application of the CartDiscount causes other discounts to be ignored.If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store.Segment of the Cart that is discounted.Date and time (UTC) from which the Discount is effective.Date and time (UTC) until which the Discount is effective.getValue()
Effect of the CartDiscount on thetarget
.Current version of the CartDiscount.int
hashCode()
void
setCartPredicate
(String cartPredicate) Valid Cart Predicate.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) for the CartDiscount was initially created.void
setCreatedBy
(CreatedBy createdBy) Present on resources created after 1 February 2019 except for events not tracked.void
setCustom
(CustomFields custom) Custom Fields of the CartDiscount.void
setDescription
(LocalizedString description) Description of the CartDiscount.void
Unique identifier of the CartDiscount.void
setIsActive
(Boolean isActive) Indicates if the CartDiscount is active and can be applied to the Cart.void
User-defined unique identifier of the CartDiscount.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) for the CartDiscount was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) Present on resources updated after 1 February 2019 except for events not tracked.void
setName
(LocalizedString name) Name of the CartDiscount.void
setReferences
(Reference... references) References of all resources that are addressed in the predicate.void
setReferences
(List<Reference> references) References of all resources that are addressed in the predicate.void
setRequiresDiscountCode
(Boolean requiresDiscountCode) Indicates if the Discount is used in connection with a DiscountCode.void
setSortOrder
(String sortOrder) Value between0
and1
.void
setStackingMode
(StackingMode stackingMode) Indicates whether the application of the CartDiscount causes other discounts to be ignored.void
setStores
(StoreKeyReference... stores) If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store.void
setStores
(List<StoreKeyReference> stores) If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store.void
setTarget
(CartDiscountTarget target) Segment of the Cart that is discounted.void
setValidFrom
(ZonedDateTime validFrom) Date and time (UTC) from which the Discount is effective.void
setValidUntil
(ZonedDateTime validUntil) Date and time (UTC) until which the Discount is effective.void
setValue
(CartDiscountValue value) Effect of the CartDiscount on thetarget
.void
setVersion
(Long version) Current version of the CartDiscount.toString()
Methods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.cart_discount.CartDiscount
withCartDiscount
Methods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountMixin
toReference, toResourceIdentifier
Methods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
Methods inherited from interface com.commercetools.api.models.DomainResource
get
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
-
Constructor Details
-
CartDiscountImpl
public CartDiscountImpl()create empty instance
-
-
Method Details
-
getId
Unique identifier of the CartDiscount.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceCartDiscount
- Specified by:
getId
in interfaceDomainResource<CartDiscount>
- Specified by:
getId
in interfaceIdentifiable<CartDiscount>
- Specified by:
getId
in interfaceVersioned<CartDiscount>
- Returns:
- id
-
getVersion
Current version of the CartDiscount.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceCartDiscount
- Specified by:
getVersion
in interfaceDomainResource<CartDiscount>
- Specified by:
getVersion
in interfaceVersioned<CartDiscount>
- Returns:
- version
-
getCreatedAt
Date and time (UTC) for the CartDiscount was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Specified by:
getCreatedAt
in interfaceCartDiscount
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) for the CartDiscount was last updated.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Specified by:
getLastModifiedAt
in interfaceCartDiscount
- Returns:
- lastModifiedAt
-
getLastModifiedBy
Present on resources updated after 1 February 2019 except for events not tracked.
- Specified by:
getLastModifiedBy
in interfaceCartDiscount
- Returns:
- lastModifiedBy
-
getCreatedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Specified by:
getCreatedBy
in interfaceCartDiscount
- Returns:
- createdBy
-
getName
Name of the CartDiscount.
- Specified by:
getName
in interfaceCartDiscount
- Returns:
- name
-
getKey
User-defined unique identifier of the CartDiscount.
- Specified by:
getKey
in interfaceCartDiscount
- Specified by:
getKey
in interfaceWithKey
- Returns:
- key
-
getDescription
Description of the CartDiscount.
- Specified by:
getDescription
in interfaceCartDiscount
- Returns:
- description
-
getValue
Effect of the CartDiscount on the
target
.- Specified by:
getValue
in interfaceCartDiscount
- Returns:
- value
-
getCartPredicate
Valid Cart Predicate.
- Specified by:
getCartPredicate
in interfaceCartDiscount
- Returns:
- cartPredicate
-
getTarget
Segment of the Cart that is discounted.
Empty, if the
value
isgiftLineItem
.- Specified by:
getTarget
in interfaceCartDiscount
- Returns:
- target
-
getSortOrder
Value between
0
and1
. All matching CartDiscounts are applied to a Cart in the order defined by this field. A Discount with a higher sortOrder is prioritized. The sort order is unambiguous among all CartDiscounts.- Specified by:
getSortOrder
in interfaceCartDiscount
- Returns:
- sortOrder
-
getStores
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
- If empty, the Cart Discount applies on all Carts, irrespective of a Store.
- Specified by:
getStores
in interfaceCartDiscount
- Returns:
- stores
-
getIsActive
Indicates if the CartDiscount is active and can be applied to the Cart.
- Specified by:
getIsActive
in interfaceCartDiscount
- Returns:
- isActive
-
getValidFrom
Date and time (UTC) from which the Discount is effective.
- Specified by:
getValidFrom
in interfaceCartDiscount
- Returns:
- validFrom
-
getValidUntil
Date and time (UTC) until which the Discount is effective.
- Specified by:
getValidUntil
in interfaceCartDiscount
- Returns:
- validUntil
-
getRequiresDiscountCode
Indicates if the Discount is used in connection with a DiscountCode.
- Specified by:
getRequiresDiscountCode
in interfaceCartDiscount
- Returns:
- requiresDiscountCode
-
getReferences
References of all resources that are addressed in the predicate. The API generates this array from the predicate.
- Specified by:
getReferences
in interfaceCartDiscount
- Returns:
- references
-
getStackingMode
Indicates whether the application of the CartDiscount causes other discounts to be ignored.
- Specified by:
getStackingMode
in interfaceCartDiscount
- Returns:
- stackingMode
-
getCustom
Custom Fields of the CartDiscount.
- Specified by:
getCustom
in interfaceCartDiscount
- Specified by:
getCustom
in interfaceCustomizable<CartDiscount>
- Returns:
- custom
-
setId
Description copied from interface:CartDiscount
Unique identifier of the CartDiscount.
- Specified by:
setId
in interfaceBaseResource
- Specified by:
setId
in interfaceCartDiscount
- Parameters:
id
- value to be set
-
setVersion
Description copied from interface:CartDiscount
Current version of the CartDiscount.
- Specified by:
setVersion
in interfaceBaseResource
- Specified by:
setVersion
in interfaceCartDiscount
- Parameters:
version
- value to be set
-
setCreatedAt
Description copied from interface:CartDiscount
Date and time (UTC) for the CartDiscount was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Specified by:
setCreatedAt
in interfaceCartDiscount
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Description copied from interface:CartDiscount
Date and time (UTC) for the CartDiscount was last updated.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Specified by:
setLastModifiedAt
in interfaceCartDiscount
- Parameters:
lastModifiedAt
- value to be set
-
setLastModifiedBy
Description copied from interface:CartDiscount
Present on resources updated after 1 February 2019 except for events not tracked.
- Specified by:
setLastModifiedBy
in interfaceCartDiscount
- Parameters:
lastModifiedBy
- value to be set
-
setCreatedBy
Description copied from interface:CartDiscount
Present on resources created after 1 February 2019 except for events not tracked.
- Specified by:
setCreatedBy
in interfaceCartDiscount
- Parameters:
createdBy
- value to be set
-
setName
Description copied from interface:CartDiscount
Name of the CartDiscount.
- Specified by:
setName
in interfaceCartDiscount
- Parameters:
name
- value to be set
-
setKey
Description copied from interface:CartDiscount
User-defined unique identifier of the CartDiscount.
- Specified by:
setKey
in interfaceCartDiscount
- Parameters:
key
- value to be set
-
setDescription
Description copied from interface:CartDiscount
Description of the CartDiscount.
- Specified by:
setDescription
in interfaceCartDiscount
- Parameters:
description
- value to be set
-
setValue
Description copied from interface:CartDiscount
Effect of the CartDiscount on the
target
.- Specified by:
setValue
in interfaceCartDiscount
- Parameters:
value
- value to be set
-
setCartPredicate
Description copied from interface:CartDiscount
Valid Cart Predicate.
- Specified by:
setCartPredicate
in interfaceCartDiscount
- Parameters:
cartPredicate
- value to be set
-
setTarget
Description copied from interface:CartDiscount
Segment of the Cart that is discounted.
Empty, if the
value
isgiftLineItem
.- Specified by:
setTarget
in interfaceCartDiscount
- Parameters:
target
- value to be set
-
setSortOrder
Description copied from interface:CartDiscount
Value between
0
and1
. All matching CartDiscounts are applied to a Cart in the order defined by this field. A Discount with a higher sortOrder is prioritized. The sort order is unambiguous among all CartDiscounts.- Specified by:
setSortOrder
in interfaceCartDiscount
- Parameters:
sortOrder
- value to be set
-
setStores
Description copied from interface:CartDiscount
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
- If empty, the Cart Discount applies on all Carts, irrespective of a Store.
- Specified by:
setStores
in interfaceCartDiscount
- Parameters:
stores
- values to be set
-
setStores
Description copied from interface:CartDiscount
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
- If empty, the Cart Discount applies on all Carts, irrespective of a Store.
- Specified by:
setStores
in interfaceCartDiscount
- Parameters:
stores
- values to be set
-
setIsActive
Description copied from interface:CartDiscount
Indicates if the CartDiscount is active and can be applied to the Cart.
- Specified by:
setIsActive
in interfaceCartDiscount
- Parameters:
isActive
- value to be set
-
setValidFrom
Description copied from interface:CartDiscount
Date and time (UTC) from which the Discount is effective.
- Specified by:
setValidFrom
in interfaceCartDiscount
- Parameters:
validFrom
- value to be set
-
setValidUntil
Description copied from interface:CartDiscount
Date and time (UTC) until which the Discount is effective.
- Specified by:
setValidUntil
in interfaceCartDiscount
- Parameters:
validUntil
- value to be set
-
setRequiresDiscountCode
Description copied from interface:CartDiscount
Indicates if the Discount is used in connection with a DiscountCode.
- Specified by:
setRequiresDiscountCode
in interfaceCartDiscount
- Parameters:
requiresDiscountCode
- value to be set
-
setReferences
Description copied from interface:CartDiscount
References of all resources that are addressed in the predicate. The API generates this array from the predicate.
- Specified by:
setReferences
in interfaceCartDiscount
- Parameters:
references
- values to be set
-
setReferences
Description copied from interface:CartDiscount
References of all resources that are addressed in the predicate. The API generates this array from the predicate.
- Specified by:
setReferences
in interfaceCartDiscount
- Parameters:
references
- values to be set
-
setStackingMode
Description copied from interface:CartDiscount
Indicates whether the application of the CartDiscount causes other discounts to be ignored.
- Specified by:
setStackingMode
in interfaceCartDiscount
- Parameters:
stackingMode
- value to be set
-
setCustom
Description copied from interface:CartDiscount
Custom Fields of the CartDiscount.
- Specified by:
setCustom
in interfaceCartDiscount
- Specified by:
setCustom
in interfaceCustomizable<CartDiscount>
- Parameters:
custom
- value to be set
-
equals
-
hashCode
public int hashCode() -
toString
-