Class CartDiscountImpl

java.lang.Object
com.commercetools.api.models.cart_discount.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

public class CartDiscountImpl extends Object implements CartDiscount, io.vrap.rmf.base.client.ModelBase
CartDiscount
  • Constructor Details

    • CartDiscountImpl

      public CartDiscountImpl()
      create empty instance
  • Method Details

    • getId

      public String getId()

      Unique identifier of the CartDiscount.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface CartDiscount
      Specified by:
      getId in interface DomainResource<CartDiscount>
      Specified by:
      getId in interface Identifiable<CartDiscount>
      Specified by:
      getId in interface Versioned<CartDiscount>
      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the CartDiscount.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface CartDiscount
      Specified by:
      getVersion in interface DomainResource<CartDiscount>
      Specified by:
      getVersion in interface Versioned<CartDiscount>
      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) for the CartDiscount was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Specified by:
      getCreatedAt in interface CartDiscount
      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) for the CartDiscount was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Specified by:
      getLastModifiedAt in interface CartDiscount
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      public LastModifiedBy getLastModifiedBy()

      Present on resources updated after 1 February 2019 except for events not tracked.

      Specified by:
      getLastModifiedBy in interface CartDiscount
      Returns:
      lastModifiedBy
    • getCreatedBy

      public CreatedBy getCreatedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Specified by:
      getCreatedBy in interface CartDiscount
      Returns:
      createdBy
    • getName

      public LocalizedString getName()

      Name of the CartDiscount.

      Specified by:
      getName in interface CartDiscount
      Returns:
      name
    • getKey

      public String getKey()

      User-defined unique identifier of the CartDiscount.

      Specified by:
      getKey in interface CartDiscount
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getDescription

      public LocalizedString getDescription()

      Description of the CartDiscount.

      Specified by:
      getDescription in interface CartDiscount
      Returns:
      description
    • getValue

      public CartDiscountValue getValue()

      Effect of the CartDiscount on the target.

      Specified by:
      getValue in interface CartDiscount
      Returns:
      value
    • getCartPredicate

      public String getCartPredicate()

      Valid Cart Predicate.

      Specified by:
      getCartPredicate in interface CartDiscount
      Returns:
      cartPredicate
    • getTarget

      public CartDiscountTarget getTarget()

      Segment of the Cart that is discounted.

      Empty, if the value is giftLineItem.

      Specified by:
      getTarget in interface CartDiscount
      Returns:
      target
    • getSortOrder

      public String getSortOrder()

      Value between 0 and 1. 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 interface CartDiscount
      Returns:
      sortOrder
    • getStores

      public List<StoreKeyReference> 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 interface CartDiscount
      Returns:
      stores
    • getIsActive

      public Boolean getIsActive()

      Indicates if the CartDiscount is active and can be applied to the Cart.

      Specified by:
      getIsActive in interface CartDiscount
      Returns:
      isActive
    • getValidFrom

      public ZonedDateTime getValidFrom()

      Date and time (UTC) from which the Discount is effective.

      Specified by:
      getValidFrom in interface CartDiscount
      Returns:
      validFrom
    • getValidUntil

      public ZonedDateTime getValidUntil()

      Date and time (UTC) until which the Discount is effective.

      Specified by:
      getValidUntil in interface CartDiscount
      Returns:
      validUntil
    • getRequiresDiscountCode

      public Boolean getRequiresDiscountCode()

      Indicates if the Discount is used in connection with a DiscountCode.

      Specified by:
      getRequiresDiscountCode in interface CartDiscount
      Returns:
      requiresDiscountCode
    • getReferences

      public List<Reference> getReferences()

      References of all resources that are addressed in the predicate. The API generates this array from the predicate.

      Specified by:
      getReferences in interface CartDiscount
      Returns:
      references
    • getStackingMode

      public StackingMode getStackingMode()

      Indicates whether the application of the CartDiscount causes other discounts to be ignored.

      Specified by:
      getStackingMode in interface CartDiscount
      Returns:
      stackingMode
    • getCustom

      public CustomFields getCustom()

      Custom Fields of the CartDiscount.

      Specified by:
      getCustom in interface CartDiscount
      Specified by:
      getCustom in interface Customizable<CartDiscount>
      Returns:
      custom
    • setId

      public void setId(String id)
      Description copied from interface: CartDiscount

      Unique identifier of the CartDiscount.

      Specified by:
      setId in interface BaseResource
      Specified by:
      setId in interface CartDiscount
      Parameters:
      id - value to be set
    • setVersion

      public void setVersion(Long version)
      Description copied from interface: CartDiscount

      Current version of the CartDiscount.

      Specified by:
      setVersion in interface BaseResource
      Specified by:
      setVersion in interface CartDiscount
      Parameters:
      version - value to be set
    • setCreatedAt

      public void setCreatedAt(ZonedDateTime createdAt)
      Description copied from interface: CartDiscount

      Date and time (UTC) for the CartDiscount was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Specified by:
      setCreatedAt in interface CartDiscount
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      public void setLastModifiedAt(ZonedDateTime lastModifiedAt)
      Description copied from interface: CartDiscount

      Date and time (UTC) for the CartDiscount was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Specified by:
      setLastModifiedAt in interface CartDiscount
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      public void setLastModifiedBy(LastModifiedBy lastModifiedBy)
      Description copied from interface: CartDiscount

      Present on resources updated after 1 February 2019 except for events not tracked.

      Specified by:
      setLastModifiedBy in interface CartDiscount
      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      public void setCreatedBy(CreatedBy createdBy)
      Description copied from interface: CartDiscount

      Present on resources created after 1 February 2019 except for events not tracked.

      Specified by:
      setCreatedBy in interface CartDiscount
      Parameters:
      createdBy - value to be set
    • setName

      public void setName(LocalizedString name)
      Description copied from interface: CartDiscount

      Name of the CartDiscount.

      Specified by:
      setName in interface CartDiscount
      Parameters:
      name - value to be set
    • setKey

      public void setKey(String key)
      Description copied from interface: CartDiscount

      User-defined unique identifier of the CartDiscount.

      Specified by:
      setKey in interface CartDiscount
      Parameters:
      key - value to be set
    • setDescription

      public void setDescription(LocalizedString description)
      Description copied from interface: CartDiscount

      Description of the CartDiscount.

      Specified by:
      setDescription in interface CartDiscount
      Parameters:
      description - value to be set
    • setValue

      public void setValue(CartDiscountValue value)
      Description copied from interface: CartDiscount

      Effect of the CartDiscount on the target.

      Specified by:
      setValue in interface CartDiscount
      Parameters:
      value - value to be set
    • setCartPredicate

      public void setCartPredicate(String cartPredicate)
      Description copied from interface: CartDiscount

      Valid Cart Predicate.

      Specified by:
      setCartPredicate in interface CartDiscount
      Parameters:
      cartPredicate - value to be set
    • setTarget

      public void setTarget(CartDiscountTarget target)
      Description copied from interface: CartDiscount

      Segment of the Cart that is discounted.

      Empty, if the value is giftLineItem.

      Specified by:
      setTarget in interface CartDiscount
      Parameters:
      target - value to be set
    • setSortOrder

      public void setSortOrder(String sortOrder)
      Description copied from interface: CartDiscount

      Value between 0 and 1. 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 interface CartDiscount
      Parameters:
      sortOrder - value to be set
    • setStores

      public void setStores(StoreKeyReference... stores)
      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 interface CartDiscount
      Parameters:
      stores - values to be set
    • setStores

      public void setStores(List<StoreKeyReference> stores)
      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 interface CartDiscount
      Parameters:
      stores - values to be set
    • setIsActive

      public void setIsActive(Boolean isActive)
      Description copied from interface: CartDiscount

      Indicates if the CartDiscount is active and can be applied to the Cart.

      Specified by:
      setIsActive in interface CartDiscount
      Parameters:
      isActive - value to be set
    • setValidFrom

      public void setValidFrom(ZonedDateTime validFrom)
      Description copied from interface: CartDiscount

      Date and time (UTC) from which the Discount is effective.

      Specified by:
      setValidFrom in interface CartDiscount
      Parameters:
      validFrom - value to be set
    • setValidUntil

      public void setValidUntil(ZonedDateTime validUntil)
      Description copied from interface: CartDiscount

      Date and time (UTC) until which the Discount is effective.

      Specified by:
      setValidUntil in interface CartDiscount
      Parameters:
      validUntil - value to be set
    • setRequiresDiscountCode

      public void setRequiresDiscountCode(Boolean requiresDiscountCode)
      Description copied from interface: CartDiscount

      Indicates if the Discount is used in connection with a DiscountCode.

      Specified by:
      setRequiresDiscountCode in interface CartDiscount
      Parameters:
      requiresDiscountCode - value to be set
    • setReferences

      public void setReferences(Reference... references)
      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 interface CartDiscount
      Parameters:
      references - values to be set
    • setReferences

      public void setReferences(List<Reference> references)
      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 interface CartDiscount
      Parameters:
      references - values to be set
    • setStackingMode

      public void setStackingMode(StackingMode stackingMode)
      Description copied from interface: CartDiscount

      Indicates whether the application of the CartDiscount causes other discounts to be ignored.

      Specified by:
      setStackingMode in interface CartDiscount
      Parameters:
      stackingMode - value to be set
    • setCustom

      public void setCustom(CustomFields custom)
      Description copied from interface: CartDiscount

      Custom Fields of the CartDiscount.

      Specified by:
      setCustom in interface CartDiscount
      Specified by:
      setCustom in interface Customizable<CartDiscount>
      Parameters:
      custom - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object