com.elasticpath.domain.catalog.impl
Class PriceTierImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractValueObjectImpl
              extended by com.elasticpath.domain.catalog.impl.PriceTierImpl
All Implemented Interfaces:
PriceTier, EpDomain, Persistence, ValueObject, java.io.Serializable

public class PriceTierImpl
extends AbstractValueObjectImpl
implements PriceTier

PriceTier represents different price for different minimum quantity A Price should at least have a PriceTier When shopping a product, if quantity is provided, Price should get the nearest PriceTier with the minimum quantity equal or less than the given quantity. If no quantity is provided, the Price will retrieve the first price tier, i.e. the one with smallest minimum quantity.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
PriceTierImpl()
           
 
Method Summary
 void clearComputedPrice()
          Clear the computed price of the price tier, will set the computed price to null.
 java.math.BigDecimal getComputedPrice()
          Get the computed price of the price tier.
 ElasticPath getElasticPath()
          This is a work around for the Elastic Path not being set by Spring (because this is a component class?).
 java.math.BigDecimal getListPrice()
          Get the list price of the price tier.
 int getMinQty()
          Get the minimum quantity of the price tier.
 java.math.BigDecimal getPrePromotionPrice()
          Get the pre-promotion price to which promotions are to be applied.
 java.math.BigDecimal getSalePrice()
          Get the sale price of the price tier.
 void setComputedPrice(java.math.BigDecimal computedPrice)
          Set the computed price of the price tier.
 void setDefaultValues()
          set default values for price tier.
 void setListPrice(java.math.BigDecimal listPrice)
          Set the list price for the price tier.
 void setMinQty(int minQty)
          Set the minimum quantity for the price tier.
 void setSalePrice(java.math.BigDecimal salePrice)
          Set the sale price for the price tier.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

PriceTierImpl

public PriceTierImpl()
Method Detail

clearComputedPrice

public void clearComputedPrice()
Clear the computed price of the price tier, will set the computed price to null.

Specified by:
clearComputedPrice in interface PriceTier

getComputedPrice

public java.math.BigDecimal getComputedPrice()
Get the computed price of the price tier.

Specified by:
getComputedPrice in interface PriceTier
Returns:
the computed price of the price tier

getElasticPath

public ElasticPath getElasticPath()
This is a work around for the Elastic Path not being set by Spring (because this is a component class?).

Specified by:
getElasticPath in interface EpDomain
Overrides:
getElasticPath in class AbstractEpDomainImpl
Returns:
an ElasticPath instance

getListPrice

public java.math.BigDecimal getListPrice()
Get the list price of the price tier.

Specified by:
getListPrice in interface PriceTier
Returns:
the list price of the price tier

getMinQty

public int getMinQty()
Get the minimum quantity of the price tier.

Specified by:
getMinQty in interface PriceTier
Returns:
the minimum quantity of the price tier

getPrePromotionPrice

public java.math.BigDecimal getPrePromotionPrice()
Get the pre-promotion price to which promotions are to be applied. This is currently the lower of the sale price and the list price.

Specified by:
getPrePromotionPrice in interface PriceTier
Returns:
the lower of the sale price and the list price of the price tier

getSalePrice

public java.math.BigDecimal getSalePrice()
Get the sale price of the price tier.

Specified by:
getSalePrice in interface PriceTier
Returns:
the sale price of the price tier

setComputedPrice

public void setComputedPrice(java.math.BigDecimal computedPrice)
Set the computed price of the price tier. If a computed price already exists, the specified computed price will only be set if it is lower than the previously existing computed price.

Specified by:
setComputedPrice in interface PriceTier
Parameters:
computedPrice - the computed price of the price tier

setDefaultValues

public void setDefaultValues()
set default values for price tier. This method will be used by JUnit.

Specified by:
setDefaultValues in interface Persistence
Overrides:
setDefaultValues in class AbstractPersistenceImpl

setListPrice

public void setListPrice(java.math.BigDecimal listPrice)
Set the list price for the price tier.

Specified by:
setListPrice in interface PriceTier
Parameters:
listPrice - the list price of the price tier

setMinQty

public void setMinQty(int minQty)
Set the minimum quantity for the price tier.

Specified by:
setMinQty in interface PriceTier
Parameters:
minQty - the minimum quantity of the price tier

setSalePrice

public void setSalePrice(java.math.BigDecimal salePrice)
Set the sale price for the price tier.

Specified by:
setSalePrice in interface PriceTier
Parameters:
salePrice - the sale price of the price tier