com.elasticpath.domain.catalog
Interface Price

All Superinterfaces:
EpDomain, Persistence, java.io.Serializable, ValueObject
All Known Subinterfaces:
ProductPrice, SkuPrice
All Known Implementing Classes:
AbstractPriceImpl, ProductPriceImpl, SkuPriceImpl

public interface Price
extends ValueObject

Interface implemented by classes representing product or service prices.


Method Summary
 void addOrUpdatePriceTier(PriceTier priceTier)
          add the price Tiers.
 void clearComputedPrice()
          Removes the computed price.
 Money getComputedPrice()
          Get the product's computed price (e.g.
 Money getComputedPrice(int qty)
          Get the product's computed price (e.g.
 java.util.Currency getCurrency()
          Get the currency for this product price.
 Money getDollarSavings()
          Calculates the MoneyImpl savings if the price has a discount.
 Money getDollarSavings(int qty)
          Calculates the MoneyImpl savings if the price has a discount.
 Money getListPrice()
          Get the product's list price.
 Money getListPrice(int qty)
          Get the product's list price.
 Money getLowestPrice()
          Returns the lowest of the price values specified in this Price.
 Money getLowestPrice(int qty)
          Get the lowest of the price values specified in this Price.
 Money getPrePromotionPrice()
          Get the pre-promotion price of the first price tier to which promotions are to be applied.
 Money getPrePromotionPrice(int qty)
          Get the pre-promotion price of the corresponding price tier, which promotions are to be applied.
 PriceTier getPriceTierByExactMinQty(int minQty)
          Get the Price tier with the same minimum quantity with the inputed min Qty.
 java.util.Map getPriceTiers()
          Get the price Tiers.
 Money getSalePrice()
          Get the product's sale price.
 Money getSalePrice(int qty)
          Get the product's sale price.
 boolean hasPriceTiers()
          Check if the product has price tiers.
 boolean isLowestLessThanList()
          Check if the lowest price is less than the list price, i.e.
 boolean isLowestLessThanList(int qty)
          Check if the lowest price is less than the list price, i.e.
 void setComputedPrice(Money computedPrice)
          Set the product's computed price (e.g.
 void setComputedPrice(Money computedPrice, int minQty)
          Set the product's computed price (e.g.
 void setCurrency(java.util.Currency currency)
          Set the currency for the price.
 void setListPrice(Money listPrice)
          Set the product's list price.
 void setListPrice(Money listPrice, int minQty)
          Set the product's list price.
 void setPriceTiers(java.util.Map priceTiers)
          set the price Tiers.
 void setSalePrice(Money salePrice)
          Set the product's sale price.
 void setSalePrice(Money salePrice, int minQty)
          Set the product's sale price.
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Method Detail

addOrUpdatePriceTier

void addOrUpdatePriceTier(PriceTier priceTier)
add the price Tiers.

Parameters:
priceTier - the price tier to be added

clearComputedPrice

void clearComputedPrice()
Removes the computed price.


getComputedPrice

Money getComputedPrice()
Get the product's computed price (e.g. the result of executing a rule).

Returns:
the sale price as a MoneyImpl Returns null if no computed price has been set

getComputedPrice

Money getComputedPrice(int qty)
Get the product's computed price (e.g. the result of executing a rule).

Parameters:
qty - the quantity of the product
Returns:
the computed price as a MoneyImpl Returns null if no computed price has been set

getCurrency

java.util.Currency getCurrency()
Get the currency for this product price.

Returns:
the Currency

getDollarSavings

Money getDollarSavings()
Calculates the MoneyImpl savings if the price has a discount.

Returns:
the price savings as a MoneyImpl

getDollarSavings

Money getDollarSavings(int qty)
Calculates the MoneyImpl savings if the price has a discount.

Parameters:
qty - the quantity of the product
Returns:
the price savings as a MoneyImpl

getListPrice

Money getListPrice()
Get the product's list price.

Returns:
the list price as a MoneyImpl

getListPrice

Money getListPrice(int qty)
Get the product's list price.

Parameters:
qty - of the product
Returns:
the list price as a MoneyImpl

getLowestPrice

Money getLowestPrice()
Returns the lowest of the price values specified in this Price.

Returns:
the lowest price as a MoneyImpl

getLowestPrice

Money getLowestPrice(int qty)
Get the lowest of the price values specified in this Price.

Parameters:
qty - the quantity of the product
Returns:
the lowest price as a MoneyImpl

getPrePromotionPrice

Money getPrePromotionPrice()
Get the pre-promotion price of the first price tier to which promotions are to be applied. This is currently the lower of the sale price and the list price.

Returns:
a Money object representing the pre-promotion price

getPrePromotionPrice

Money getPrePromotionPrice(int qty)
Get the pre-promotion price of the corresponding price tier, which promotions are to be applied. This is currently the lower of the sale price and the list price.

Parameters:
qty - the quantity of the product
Returns:
a Money object representing the pre-promotion price

getPriceTierByExactMinQty

PriceTier getPriceTierByExactMinQty(int minQty)
Get the Price tier with the same minimum quantity with the inputed min Qty.

Parameters:
minQty - the minumum quantity to be matched
Returns:
the matched PriceTier

getPriceTiers

java.util.Map getPriceTiers()
Get the price Tiers.

Returns:
the map of price tiers for this product price as a PriceTierImpl

getSalePrice

Money getSalePrice()
Get the product's sale price.

Returns:
the sale price as a MoneyImpl Returns null if there is no sale price specified

getSalePrice

Money getSalePrice(int qty)
Get the product's sale price.

Parameters:
qty - the quantity of the product
Returns:
the sale price as a MoneyImpl

hasPriceTiers

boolean hasPriceTiers()
Check if the product has price tiers. Each product should at least has one price (default price tier) set up.

Returns:
true if the product has more than one price tiers for different minimum quantity false if the product has only one price tier or no price tier set up

isLowestLessThanList

boolean isLowestLessThanList()
Check if the lowest price is less than the list price, i.e. the price has a discount.

Returns:
true if the price has a lower price than the list price.

isLowestLessThanList

boolean isLowestLessThanList(int qty)
Check if the lowest price is less than the list price, i.e. the price has a discount.

Parameters:
qty - the quantity of the product
Returns:
true if the price has a lower price than the list price.

setComputedPrice

void setComputedPrice(Money computedPrice)
Set the product's computed price (e.g. the result of executing a rule).

Parameters:
computedPrice - the product's computed price as a MoneyImpl

setComputedPrice

void setComputedPrice(Money computedPrice,
                      int minQty)
Set the product's computed price (e.g. the result of executing a rule). A computed price cannot be less than zero. If a negative price is specified, the computed price will be set to zero.

Parameters:
computedPrice - the product's computed price as a MoneyImpl
minQty - the minimum quantity of the PriceTier

setCurrency

void setCurrency(java.util.Currency currency)
Set the currency for the price.

Parameters:
currency - of the price as a Currency

setListPrice

void setListPrice(Money listPrice)
Set the product's list price.

Parameters:
listPrice - the product's list price as a MoneyImpl

setListPrice

void setListPrice(Money listPrice,
                  int minQty)
Set the product's list price.

Parameters:
listPrice - the product's list price as a MoneyImpl
minQty - the minimum quantity of the PriceTier

setPriceTiers

void setPriceTiers(java.util.Map priceTiers)
set the price Tiers.

Parameters:
priceTiers - the price tiers as a map of PriceTier

setSalePrice

void setSalePrice(Money salePrice)
Set the product's sale price.

Parameters:
salePrice - the product's sale price as a MoneyImpl

setSalePrice

void setSalePrice(Money salePrice,
                  int minQty)
Set the product's sale price.

Parameters:
salePrice - the product's sale price as a MoneyImpl
minQty - the minimum quantity of the PriceTier