Class ProductDiscountDraftImpl

java.lang.Object
com.commercetools.api.models.product_discount.ProductDiscountDraftImpl
All Implemented Interfaces:
ProductDiscountDraft, WithKey, io.vrap.rmf.base.client.Draft<ProductDiscountDraft>, io.vrap.rmf.base.client.ModelBase

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

    • ProductDiscountDraftImpl

      public ProductDiscountDraftImpl()
      create empty instance
  • Method Details

    • getName

      public LocalizedString getName()

      Name of the ProductDiscount.

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

      public String getKey()

      User-defined unique identifier for the ProductDiscount.

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

      public LocalizedString getDescription()

      Description of the ProductDiscount.

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

      public ProductDiscountValueDraft getValue()

      Type of Discount and its corresponding value.

      Specified by:
      getValue in interface ProductDiscountDraft
      Returns:
      value
    • getPredicate

      public String getPredicate()

      Valid ProductDiscount predicate.

      Specified by:
      getPredicate in interface ProductDiscountDraft
      Returns:
      predicate
    • getSortOrder

      public String getSortOrder()

      Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. The value must be unique among all ProductDiscounts in the Project.

      Specified by:
      getSortOrder in interface ProductDiscountDraft
      Returns:
      sortOrder
    • getIsActive

      public Boolean getIsActive()

      Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

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

      public ZonedDateTime getValidFrom()

      Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.

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

      public ZonedDateTime getValidUntil()

      Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.

      Specified by:
      getValidUntil in interface ProductDiscountDraft
      Returns:
      validUntil
    • setName

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

      Name of the ProductDiscount.

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

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

      User-defined unique identifier for the ProductDiscount.

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

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

      Description of the ProductDiscount.

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

      public void setValue(ProductDiscountValueDraft value)
      Description copied from interface: ProductDiscountDraft

      Type of Discount and its corresponding value.

      Specified by:
      setValue in interface ProductDiscountDraft
      Parameters:
      value - value to be set
    • setPredicate

      public void setPredicate(String predicate)
      Description copied from interface: ProductDiscountDraft

      Valid ProductDiscount predicate.

      Specified by:
      setPredicate in interface ProductDiscountDraft
      Parameters:
      predicate - value to be set
    • setSortOrder

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

      Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. The value must be unique among all ProductDiscounts in the Project.

      Specified by:
      setSortOrder in interface ProductDiscountDraft
      Parameters:
      sortOrder - value to be set
    • setIsActive

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

      Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

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

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

      Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.

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

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

      Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.

      Specified by:
      setValidUntil in interface ProductDiscountDraft
      Parameters:
      validUntil - value to be set
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object