Class PriceImpl

java.lang.Object
com.commercetools.api.models.common.PriceImpl
All Implemented Interfaces:
Price, Customizable<Price>, WithKey, io.vrap.rmf.base.client.ModelBase

public class PriceImpl extends Object implements Price, io.vrap.rmf.base.client.ModelBase

The representation for prices embedded in LineItems and in ProductVariants when the ProductPriceMode is Embedded. For the Standalone ProductPriceMode refer to StandalonePrice.

  • Constructor Details

    • PriceImpl

      public PriceImpl()
      create empty instance
  • Method Details

    • getId

      public String getId()

      Unique identifier of this Price.

      Specified by:
      getId in interface Price
      Returns:
      id
    • getKey

      public String getKey()

      User-defined identifier of the Price. It is unique per ProductVariant.

      Specified by:
      getKey in interface Price
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getValue

      public TypedMoney getValue()

      Money value of this Price.

      Specified by:
      getValue in interface Price
      Returns:
      value
    • getCountry

      public String getCountry()

      Country for which this Price is valid.

      Specified by:
      getCountry in interface Price
      Returns:
      country
    • getCustomerGroup

      CustomerGroup for which this Price is valid.

      Specified by:
      getCustomerGroup in interface Price
      Returns:
      customerGroup
    • getChannel

      ProductDistribution Channel for which this Price is valid.

      Specified by:
      getChannel in interface Price
      Returns:
      channel
    • getValidFrom

      Date and time from which this Price is valid.

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

      Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.

      Specified by:
      getValidUntil in interface Price
      Returns:
      validUntil
    • getDiscounted

      Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item Price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

      Specified by:
      getDiscounted in interface Price
      Returns:
      discounted
    • getTiers

      public List<PriceTier> getTiers()

      Present if different Prices for certain LineItem quantities have been specified.

      Specified by:
      getTiers in interface Price
      Returns:
      tiers
    • getCustom

      Custom Fields defined for the Price.

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

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

      Unique identifier of this Price.

      Specified by:
      setId in interface Price
      Parameters:
      id - value to be set
    • setKey

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

      User-defined identifier of the Price. It is unique per ProductVariant.

      Specified by:
      setKey in interface Price
      Parameters:
      key - value to be set
    • setValue

      public void setValue(TypedMoney value)
      Description copied from interface: Price

      Money value of this Price.

      Specified by:
      setValue in interface Price
      Parameters:
      value - value to be set
    • setCountry

      public void setCountry(String country)
      Description copied from interface: Price

      Country for which this Price is valid.

      Specified by:
      setCountry in interface Price
      Parameters:
      country - value to be set
    • setCustomerGroup

      public void setCustomerGroup(CustomerGroupReference customerGroup)
      Description copied from interface: Price

      CustomerGroup for which this Price is valid.

      Specified by:
      setCustomerGroup in interface Price
      Parameters:
      customerGroup - value to be set
    • setChannel

      public void setChannel(ChannelReference channel)
      Description copied from interface: Price

      ProductDistribution Channel for which this Price is valid.

      Specified by:
      setChannel in interface Price
      Parameters:
      channel - value to be set
    • setValidFrom

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

      Date and time from which this Price is valid.

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

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

      Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.

      Specified by:
      setValidUntil in interface Price
      Parameters:
      validUntil - value to be set
    • setDiscounted

      public void setDiscounted(DiscountedPrice discounted)
      Description copied from interface: Price

      Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item Price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

      Specified by:
      setDiscounted in interface Price
      Parameters:
      discounted - value to be set
    • setTiers

      public void setTiers(PriceTier... tiers)
      Description copied from interface: Price

      Present if different Prices for certain LineItem quantities have been specified.

      Specified by:
      setTiers in interface Price
      Parameters:
      tiers - values to be set
    • setTiers

      public void setTiers(List<PriceTier> tiers)
      Description copied from interface: Price

      Present if different Prices for certain LineItem quantities have been specified.

      Specified by:
      setTiers in interface Price
      Parameters:
      tiers - values to be set
    • setCustom

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

      Custom Fields defined for the Price.

      Specified by:
      setCustom in interface Customizable<Price>
      Specified by:
      setCustom in interface Price
      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