Class DiscountCodeImpl

java.lang.Object
com.commercetools.api.models.discount_code.DiscountCodeImpl
All Implemented Interfaces:
BaseResource, Customizable<DiscountCode>, DiscountCode, DiscountCodeMixin, DomainResource<DiscountCode>, Identifiable<DiscountCode>, Referencable<DiscountCode>, ResourceIdentifiable<DiscountCode>, Versioned<DiscountCode>, io.vrap.rmf.base.client.ModelBase

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

    • DiscountCodeImpl

      public DiscountCodeImpl()
      create empty instance
  • Method Details

    • getId

      public String getId()

      Unique identifier of the DiscountCode.

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

      public Long getVersion()

      Current version of the DiscountCode.

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

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the DiscountCode was initially created.

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

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the DiscountCode was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Specified by:
      getLastModifiedAt in interface DiscountCode
      Returns:
      lastModifiedAt
    • getKey

      public String getKey()

      User-defined unique identifier of the DiscountCode.

      Specified by:
      getKey in interface DiscountCode
      Returns:
      key
    • getLastModifiedBy

      public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the DiscountCode.

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

      public CreatedBy getCreatedBy()

      IDs and references that created the DiscountCode.

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

      public LocalizedString getName()

      Name of the DiscountCode.

      Specified by:
      getName in interface DiscountCode
      Returns:
      name
    • getDescription

      public LocalizedString getDescription()

      Description of the DiscountCode.

      Specified by:
      getDescription in interface DiscountCode
      Returns:
      description
    • getCode

      public String getCode()

      User-defined unique identifier of the DiscountCode added to the Cart to apply the related CartDiscounts.

      Specified by:
      getCode in interface DiscountCode
      Returns:
      code
    • getCartDiscounts

      public List<CartDiscountReference> getCartDiscounts()

      Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.

      Specified by:
      getCartDiscounts in interface DiscountCode
      Returns:
      cartDiscounts
    • getCartPredicate

      public String getCartPredicate()

      DiscountCode can only be applied to Carts that match this predicate.

      Specified by:
      getCartPredicate in interface DiscountCode
      Returns:
      cartPredicate
    • getIsActive

      public Boolean getIsActive()

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

      Specified by:
      getIsActive in interface DiscountCode
      Returns:
      isActive
    • getReferences

      public List<Reference> getReferences()

      References to all resources addressed in the cartPredicate by their IDs. This value is generated by the platform.

      Specified by:
      getReferences in interface DiscountCode
      Returns:
      references
    • getMaxApplications

      public Long getMaxApplications()

      Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count. This field does not limit discount applications for Orders created from a Recurring Order.

      Specified by:
      getMaxApplications in interface DiscountCode
      Returns:
      maxApplications
    • getMaxApplicationsPerCustomer

      public Long getMaxApplicationsPerCustomer()

      Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count. This field does not limit discount applications for Orders created from a Recurring Order.

      Specified by:
      getMaxApplicationsPerCustomer in interface DiscountCode
      Returns:
      maxApplicationsPerCustomer
    • getCustom

      public CustomFields getCustom()

      Custom Fields of the DiscountCode.

      Specified by:
      getCustom in interface Customizable<DiscountCode>
      Specified by:
      getCustom in interface DiscountCode
      Returns:
      custom
    • getGroups

      public List<String> getGroups()

      Groups to which the DiscountCode belongs to.

      Specified by:
      getGroups in interface DiscountCode
      Returns:
      groups
    • getValidFrom

      public ZonedDateTime getValidFrom()

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

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

      public ZonedDateTime getValidUntil()

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

      Specified by:
      getValidUntil in interface DiscountCode
      Returns:
      validUntil
    • getApplicationVersion

      public Long getApplicationVersion()

      Used and managed by the API and must not be used in customer logic. The value can change at any time due to internal and external factors.

      Specified by:
      getApplicationVersion in interface DiscountCode
      Returns:
      applicationVersion
    • setId

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

      Unique identifier of the DiscountCode.

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

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

      Current version of the DiscountCode.

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

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

      Date and time (UTC) the DiscountCode was initially created.

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

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

      Date and time (UTC) the DiscountCode was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Specified by:
      setLastModifiedAt in interface DiscountCode
      Parameters:
      lastModifiedAt - value to be set
    • setKey

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

      User-defined unique identifier of the DiscountCode.

      Specified by:
      setKey in interface DiscountCode
      Parameters:
      key - value to be set
    • setLastModifiedBy

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

      IDs and references that last modified the DiscountCode.

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

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

      IDs and references that created the DiscountCode.

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

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

      Name of the DiscountCode.

      Specified by:
      setName in interface DiscountCode
      Parameters:
      name - value to be set
    • setDescription

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

      Description of the DiscountCode.

      Specified by:
      setDescription in interface DiscountCode
      Parameters:
      description - value to be set
    • setCode

      public void setCode(String code)
      Description copied from interface: DiscountCode

      User-defined unique identifier of the DiscountCode added to the Cart to apply the related CartDiscounts.

      Specified by:
      setCode in interface DiscountCode
      Parameters:
      code - value to be set
    • setCartDiscounts

      public void setCartDiscounts(CartDiscountReference... cartDiscounts)
      Description copied from interface: DiscountCode

      Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.

      Specified by:
      setCartDiscounts in interface DiscountCode
      Parameters:
      cartDiscounts - values to be set
    • setCartDiscounts

      public void setCartDiscounts(List<CartDiscountReference> cartDiscounts)
      Description copied from interface: DiscountCode

      Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.

      Specified by:
      setCartDiscounts in interface DiscountCode
      Parameters:
      cartDiscounts - values to be set
    • setCartPredicate

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

      DiscountCode can only be applied to Carts that match this predicate.

      Specified by:
      setCartPredicate in interface DiscountCode
      Parameters:
      cartPredicate - value to be set
    • setIsActive

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

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

      Specified by:
      setIsActive in interface DiscountCode
      Parameters:
      isActive - value to be set
    • setReferences

      public void setReferences(Reference... references)
      Description copied from interface: DiscountCode

      References to all resources addressed in the cartPredicate by their IDs. This value is generated by the platform.

      Specified by:
      setReferences in interface DiscountCode
      Parameters:
      references - values to be set
    • setReferences

      public void setReferences(List<Reference> references)
      Description copied from interface: DiscountCode

      References to all resources addressed in the cartPredicate by their IDs. This value is generated by the platform.

      Specified by:
      setReferences in interface DiscountCode
      Parameters:
      references - values to be set
    • setMaxApplications

      public void setMaxApplications(Long maxApplications)
      Description copied from interface: DiscountCode

      Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count. This field does not limit discount applications for Orders created from a Recurring Order.

      Specified by:
      setMaxApplications in interface DiscountCode
      Parameters:
      maxApplications - value to be set
    • setMaxApplicationsPerCustomer

      public void setMaxApplicationsPerCustomer(Long maxApplicationsPerCustomer)
      Description copied from interface: DiscountCode

      Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count. This field does not limit discount applications for Orders created from a Recurring Order.

      Specified by:
      setMaxApplicationsPerCustomer in interface DiscountCode
      Parameters:
      maxApplicationsPerCustomer - value to be set
    • setCustom

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

      Custom Fields of the DiscountCode.

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

      public void setGroups(String... groups)
      Description copied from interface: DiscountCode

      Groups to which the DiscountCode belongs to.

      Specified by:
      setGroups in interface DiscountCode
      Parameters:
      groups - values to be set
    • setGroups

      public void setGroups(List<String> groups)
      Description copied from interface: DiscountCode

      Groups to which the DiscountCode belongs to.

      Specified by:
      setGroups in interface DiscountCode
      Parameters:
      groups - values to be set
    • setValidFrom

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

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

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

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

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

      Specified by:
      setValidUntil in interface DiscountCode
      Parameters:
      validUntil - value to be set
    • setApplicationVersion

      public void setApplicationVersion(Long applicationVersion)
      Description copied from interface: DiscountCode

      Used and managed by the API and must not be used in customer logic. The value can change at any time due to internal and external factors.

      Specified by:
      setApplicationVersion in interface DiscountCode
      Parameters:
      applicationVersion - 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
    • copyDeep

      public DiscountCode copyDeep()
      Specified by:
      copyDeep in interface BaseResource
      Specified by:
      copyDeep in interface DiscountCode