Class CartDiscount
java.lang.Object
com.commercetools.graphql.api.types.CartDiscount
- All Implemented Interfaces:
ReferenceExpandable,Versioned
Cart discounts are recalculated every time LineItems or CustomLineItems are added or removed from the Cart or an order is created from the cart.
The number of active cart discounts that do not require a discount code (isActive=true and requiresDiscountCode=false) is limited to 100.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCartDiscount(String cartPredicate, OffsetDateTime validFrom, OffsetDateTime validUntil, StackingMode stackingMode, Boolean isActive, Boolean requiresDiscountCode, String sortOrder, String key, String name, String description, List<LocalizedString> nameAllLocales, List<LocalizedString> descriptionAllLocales, List<Reference> referenceRefs, CustomFieldsType custom, List<KeyReference> storesRef, List<Store> stores, CartDiscountValue value, CartDiscountTarget target, String id, Long version, OffsetDateTime createdAt, OffsetDateTime lastModifiedAt, Initiator createdBy, Initiator lastModifiedBy) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()getKey()getName()BETA: This feature can be subject to change and should be used carefully in production.BETA: This feature can be subject to change and should be used carefully in production.getValue()inthashCode()static CartDiscount.BuildervoidsetCartPredicate(String cartPredicate) voidsetCreatedAt(OffsetDateTime createdAt) voidsetCreatedBy(Initiator createdBy) voidsetCustom(CustomFieldsType custom) voidsetDescription(String description) voidsetDescriptionAllLocales(List<LocalizedString> descriptionAllLocales) voidvoidsetIsActive(Boolean isActive) voidvoidsetLastModifiedAt(OffsetDateTime lastModifiedAt) voidsetLastModifiedBy(Initiator lastModifiedBy) voidvoidsetNameAllLocales(List<LocalizedString> nameAllLocales) voidsetReferenceRefs(List<Reference> referenceRefs) voidsetRequiresDiscountCode(Boolean requiresDiscountCode) voidsetSortOrder(String sortOrder) voidsetStackingMode(StackingMode stackingMode) voidvoidsetStoresRef(List<KeyReference> storesRef) voidsetTarget(CartDiscountTarget target) voidsetValidFrom(OffsetDateTime validFrom) voidsetValidUntil(OffsetDateTime validUntil) voidsetValue(CartDiscountValue value) voidsetVersion(Long version) toString()
-
Constructor Details
-
CartDiscount
public CartDiscount() -
CartDiscount
public CartDiscount(String cartPredicate, OffsetDateTime validFrom, OffsetDateTime validUntil, StackingMode stackingMode, Boolean isActive, Boolean requiresDiscountCode, String sortOrder, String key, String name, String description, List<LocalizedString> nameAllLocales, List<LocalizedString> descriptionAllLocales, List<Reference> referenceRefs, CustomFieldsType custom, List<KeyReference> storesRef, List<Store> stores, CartDiscountValue value, CartDiscountTarget target, String id, Long version, OffsetDateTime createdAt, OffsetDateTime lastModifiedAt, Initiator createdBy, Initiator lastModifiedBy)
-
-
Method Details
-
getCartPredicate
-
setCartPredicate
-
getValidFrom
-
setValidFrom
-
getValidUntil
-
setValidUntil
-
getStackingMode
-
setStackingMode
-
getIsActive
-
setIsActive
-
getRequiresDiscountCode
-
setRequiresDiscountCode
-
getSortOrder
-
setSortOrder
-
getKey
-
setKey
-
getName
-
setName
-
getDescription
-
setDescription
-
getNameAllLocales
-
setNameAllLocales
-
getDescriptionAllLocales
-
setDescriptionAllLocales
-
getReferenceRefs
-
setReferenceRefs
-
getCustom
-
setCustom
-
getStoresRef
BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta -
setStoresRef
-
getStores
BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta -
setStores
-
getValue
-
setValue
-
getTarget
-
setTarget
-
getId
- Specified by:
getIdin interfaceReferenceExpandable- Specified by:
getIdin interfaceVersioned
-
setId
- Specified by:
setIdin interfaceReferenceExpandable- Specified by:
setIdin interfaceVersioned
-
getVersion
- Specified by:
getVersionin interfaceVersioned
-
setVersion
- Specified by:
setVersionin interfaceVersioned
-
getCreatedAt
- Specified by:
getCreatedAtin interfaceVersioned
-
setCreatedAt
- Specified by:
setCreatedAtin interfaceVersioned
-
getLastModifiedAt
- Specified by:
getLastModifiedAtin interfaceVersioned
-
setLastModifiedAt
- Specified by:
setLastModifiedAtin interfaceVersioned
-
getCreatedBy
- Specified by:
getCreatedByin interfaceVersioned
-
setCreatedBy
- Specified by:
setCreatedByin interfaceVersioned
-
getLastModifiedBy
- Specified by:
getLastModifiedByin interfaceVersioned
-
setLastModifiedBy
- Specified by:
setLastModifiedByin interfaceVersioned
-
toString
-
equals
-
hashCode
public int hashCode() -
newBuilder
-