public class ItemPriceSource
extends java.lang.Object
implements java.io.Serializable
PricingConstants.PRICING_OVERRIDES_PARAM
.
The properties of this object define the unit prices needed by each calculator to generate an item's price.
PricingTools
provides an API to generate a List
of these objects based on the pricing information contained in an Order. This is
useful for maintaining the original prices of an Order is subsequent pricing operations or
carrying prices from a submitted order to a new order.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.util.Map |
mAttributes |
protected java.lang.String |
mCommerceItemClassType |
protected java.lang.String |
mCurrencyCode |
protected long |
mLastListTierQuantityAdjusted |
protected double |
mLastListTierQuantityWithFractionAdjusted |
protected long |
mLastSaleTierQuantityAdjusted |
protected java.lang.Double |
mListPrice |
protected java.util.List |
mListVolumeLevels |
protected boolean |
mOnSale |
protected java.lang.String |
mParentSkuId |
protected RepositoryItem |
mPriceList |
protected java.lang.String |
mPriceListScheme |
protected java.lang.String |
mProductId |
protected java.lang.Double |
mSalePrice |
protected java.util.List |
mSaleVolumeLevels |
protected java.lang.String |
mSkuId |
Constructor and Description |
---|
ItemPriceSource(java.lang.String pProductId,
java.lang.String pSkuId,
java.lang.String pParentSkuId,
java.lang.String pCommerceItemType,
java.lang.String pCurrencyCode)
The only constructor that requires a currency code.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.Object pKey,
java.io.Serializable pAttribute)
Adds an attribute.
|
java.lang.Object |
getAttribute(java.lang.Object pKey)
Gets an attribute.
|
java.lang.String |
getCommerceItemClassType()
The class type of the commerce item to which this
source should apply.
|
java.lang.String |
getCurrencyCode()
Returns the currency code for which this
ItemPriceSource
applies. |
long |
getLastListTierQuantityAdjusted()
This contains the quantity of the last adjustment used to
generate the last list tier.
|
double |
getLastListTierQuantityAdjustedDerivedAsFloatingPoint()
This method will return a derived quantity
|
double |
getLastListTierQuantityWithFractionAdjusted()
This contains the quantity of the last adjustment used to
generate the last list tier.
|
long |
getLastSaleTierQuantityAdjusted()
This contains the quantity of the last adjustment used to
generate the last sale tier.
|
java.lang.Double |
getListPrice()
The list price used to price the item.
|
java.util.List |
getListVolumeLevels()
The List of price level repository items
used by the volume based list price calculator to
price the item.
|
java.lang.String |
getParentSkuId()
The parent sku id to which the override
applies.
|
RepositoryItem |
getPriceList()
The price list that will be set in the ItemPriceInfo.
|
java.lang.String |
getPriceListScheme()
The scheme name used to which this price source
applies.
|
java.lang.String |
getProductId()
The product id to which the override
applies
|
java.lang.Double |
getSalePrice()
The sale price used to price the item
|
java.util.List |
getSaleVolumeLevels()
The List of price level repository items
used by the volume based sale price calculator to
price the item.
|
java.lang.String |
getSkuId()
The sku id to which the override
applies
|
boolean |
isItemMatch(CommerceItem pCommerceItem,
CommerceItem pParentCommerceItem)
Matches the price source to the given item and parent item.
|
boolean |
isOnSale()
True if this source contains sale pricing
information
|
void |
removeAttribute(java.lang.Object pKey)
Removes an attribute.
|
void |
setCommerceItemClassType(java.lang.String pCommerceItemClassType) |
void |
setCurrencyCode(java.lang.String pCurrencyCode) |
void |
setLastListTierQuantityAdjusted(long pLastListTierQuantityAdjusted) |
void |
setLastListTierQuantityWithFractionAdjusted(double pLastListTierQuantityWithFractionAdjusted) |
void |
setLastSaleTierQuantityAdjusted(long pLastSaleTierQuantityAdjusted) |
void |
setListPrice(java.lang.Double pListPrice) |
void |
setListVolumeLevels(java.util.List pVolumeLevels) |
void |
setOnSale(boolean pOnSale) |
void |
setParentSkuId(java.lang.String pParentSkuId) |
void |
setPriceList(RepositoryItem pPriceList) |
void |
setPriceListScheme(java.lang.String pPriceListScheme) |
void |
setProductId(java.lang.String pProductId) |
void |
setSalePrice(java.lang.Double pSalePrice) |
void |
setSaleVolumeLevels(java.util.List pSaleVolumeLevels) |
void |
setSkuId(java.lang.String pSkuId) |
java.lang.String |
toString() |
public static java.lang.String CLASS_VERSION
protected java.lang.String mCurrencyCode
protected RepositoryItem mPriceList
protected java.lang.String mCommerceItemClassType
protected boolean mOnSale
protected java.lang.String mPriceListScheme
protected java.lang.String mProductId
protected java.lang.String mSkuId
protected java.lang.String mParentSkuId
protected java.util.Map mAttributes
protected java.lang.Double mListPrice
protected java.lang.Double mSalePrice
protected java.util.List mListVolumeLevels
protected long mLastListTierQuantityAdjusted
protected double mLastListTierQuantityWithFractionAdjusted
protected java.util.List mSaleVolumeLevels
protected long mLastSaleTierQuantityAdjusted
public ItemPriceSource(java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId, java.lang.String pCommerceItemType, java.lang.String pCurrencyCode)
pCurrencyCode
- the currency code for which this source applies.public java.lang.String getCurrencyCode()
ItemPriceSource
applies. This must match the currency code of the Order being priced when the
pricing engine maps the ItemPriceSource
objects to items in the
Orderpublic void setCurrencyCode(java.lang.String pCurrencyCode)
public RepositoryItem getPriceList()
public void setPriceList(RepositoryItem pPriceList)
public java.lang.String getCommerceItemClassType()
public void setCommerceItemClassType(java.lang.String pCommerceItemClassType)
public boolean isOnSale()
public void setOnSale(boolean pOnSale)
public java.lang.String getPriceListScheme()
public void setPriceListScheme(java.lang.String pPriceListScheme)
public java.lang.String getProductId()
public void setProductId(java.lang.String pProductId)
public java.lang.String getSkuId()
public void setSkuId(java.lang.String pSkuId)
public java.lang.String getParentSkuId()
public void setParentSkuId(java.lang.String pParentSkuId)
public void addAttribute(java.lang.Object pKey, java.io.Serializable pAttribute)
pKey
- the key to identifiying the attributeSerializable
- the attribute objectpublic java.lang.Object getAttribute(java.lang.Object pKey)
pKey
- the key that identifies the attributepublic void removeAttribute(java.lang.Object pKey)
pKey
- the key that identifies the attributepublic java.lang.Double getListPrice()
public void setListPrice(java.lang.Double pListPrice)
public java.lang.Double getSalePrice()
public void setSalePrice(java.lang.Double pSalePrice)
public java.util.List getListVolumeLevels()
public void setListVolumeLevels(java.util.List pVolumeLevels)
public long getLastListTierQuantityAdjusted()
public void setLastListTierQuantityAdjusted(long pLastListTierQuantityAdjusted)
public double getLastListTierQuantityWithFractionAdjusted()
public void setLastListTierQuantityWithFractionAdjusted(double pLastListTierQuantityWithFractionAdjusted)
public double getLastListTierQuantityAdjustedDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non null
value from the properties, lastListTierQuantityWithFractionAdjusted
,
lastListTierQuantityAdjusted
, in that order.
The method should be used where there is a need to know the lastListTierQuantityAdjusted of an item
but it is unknown to the caller as to which property (lastListTierQuantityWithFractionAdjusted
or
lastListTierQuantityAdjusted
holds the value.
public java.util.List getSaleVolumeLevels()
public void setSaleVolumeLevels(java.util.List pSaleVolumeLevels)
public long getLastSaleTierQuantityAdjusted()
public void setLastSaleTierQuantityAdjusted(long pLastSaleTierQuantityAdjusted)
public boolean isItemMatch(CommerceItem pCommerceItem, CommerceItem pParentCommerceItem)
In this implemenation, the product id, sku id, class type,
and parent sku id must match for true
to be returned
This method is used by the ItemPricingEngine
when mapping
ItemPriceSource objects to the commerce items being priced.
pCommerceItem
- the commerce item to which the ItemPriceSource must matchpParentCommerceItem
- the parent commerce item to which the ItemPriceSource must matchpublic java.lang.String toString()
toString
in class java.lang.Object