Class PriceTierImpl

java.lang.Object
com.commercetools.api.models.common.PriceTierImpl
All Implemented Interfaces:
PriceTier, io.vrap.rmf.base.client.ModelBase

public class PriceTierImpl extends Object implements PriceTier, io.vrap.rmf.base.client.ModelBase

A Price tier is selected instead of the default Price when a certain quantity of the ProductVariant is added to a Cart and ordered. For example: the Price can be lower if more than 10 items are ordered. If no Price tier is found for the Order quantity, the base Price is used. A Price tier is applied for the entire quantity of a Product Variant put as LineItem in a Cart as soon as the minimum quantity for the Price tier is reached. The Price tier is applied per Line Item of the Product Variant. If, for example, the same Product Variant appears in the same Cart as several Line Items, (what can be achieved by different values of a Custom Field on the Line Items) for each Line Item the minimum quantity must be reached to get the Price tier.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase

    io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
  • Constructor Summary

    Constructors
    Constructor
    Description
    create empty instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Minimum quantity this Price tier is valid for.
    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.
    int
     
    void
    setMinimumQuantity(Long minimumQuantity)
    Minimum quantity this Price tier is valid for.
    void
    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.vrap.rmf.base.client.ModelBase

    reflectionString, reflectionString

    Methods inherited from interface com.commercetools.api.models.common.PriceTier

    withPriceTier
  • Constructor Details

    • PriceTierImpl

      public PriceTierImpl()
      create empty instance
  • Method Details

    • getMinimumQuantity

      public Long getMinimumQuantity()

      Minimum quantity this Price tier is valid for.

      The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1. A Price or StandalonePrice cannot contain more than one tier with the same minimumQuantity.

      Specified by:
      getMinimumQuantity in interface PriceTier
      Returns:
      minimumQuantity
    • getValue

      public TypedMoney getValue()

      Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

      The currencyCode of a Price tier is always the same as the currencyCode in the value of the related Price.

      Specified by:
      getValue in interface PriceTier
      Returns:
      value
    • setMinimumQuantity

      public void setMinimumQuantity(Long minimumQuantity)
      Description copied from interface: PriceTier

      Minimum quantity this Price tier is valid for.

      The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1. A Price or StandalonePrice cannot contain more than one tier with the same minimumQuantity.

      Specified by:
      setMinimumQuantity in interface PriceTier
      Parameters:
      minimumQuantity - value to be set
    • setValue

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

      Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

      The currencyCode of a Price tier is always the same as the currencyCode in the value of the related Price.

      Specified by:
      setValue in interface PriceTier
      Parameters:
      value - value to be set
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object