public class FilteredCommerceItem extends java.lang.Object implements CommerceItem, java.lang.Cloneable
item
points to the wrapped CommerceItem
All CommerceItem methods call through to the wrapped item except for
quantity
.
FilteredCommerceItem adds two properties which are used to determine if/how the wrapped CommerceItem should participate in pricing:
CommerceItem
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
DETAILS_RANGES_VALID_FOR_TARGET |
protected java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> |
mDetailsRangesValidForQualifier
Map of DIPI to List of Range's that are valid to be evaluated as qualifiers
|
static java.lang.String |
PRICE_INFO |
static java.lang.String |
QUANTITY_AS_QUALIFIER_DETAILS |
static java.lang.String |
QUANTITY_PROPERTY_NAME |
static java.lang.String |
QUANTITY_WITH_FRACTION_PROPERTY_NAME |
static long |
serialVersionUID |
static java.lang.String |
WRAPPED_ITEM |
Constructor and Description |
---|
FilteredCommerceItem(CommerceItem pItem)
Constructs an instanceof PricingCommerceItem
|
Modifier and Type | Method and Description |
---|---|
void |
addCostCenterRelationship(CostCenterRelationship pCostCenterRelationship)
Add the CostCenterRelationship to the container.
|
void |
addCostCenterRelationship(CostCenterRelationship pCostCenterRelationship,
int pIndex)
Add the CostCenterRelationship to the container at the given index.
|
void |
addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship)
Add the PaymentGroupRelationship to the container.
|
void |
addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship,
int pIndex)
Add the PaymentGroupRelationship to the container at the given index.
|
void |
addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
Add the ShippingGroupRelationship to the container.
|
void |
addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship,
int pIndex)
Add the ShippingGroupRelationship to the container at the given index.
|
FilteredCommerceItem |
clone()
Shallow clones this filtered commerce item
|
AuxiliaryData |
getAuxiliaryData()
returns the AuxiliaryData.
|
java.lang.String |
getCatalogId()
Returns property CatalogId
|
java.lang.String |
getCatalogKey()
Returns property CatalogKey
|
java.lang.String |
getCatalogRefId()
Returns property CatalogRefId
|
java.lang.String |
getCommerceItemClassType()
Returns the commerceItemClassType
|
CostCenterRelationship |
getCostCenterRelationship(java.lang.String pCostCenterRelationshipId)
Returns the CostCenterRelationship whose id is pCostCenterRelationshipId.
|
int |
getCostCenterRelationshipCount()
Returns the number of CostCenterRelationships in the container.
|
java.util.List |
getCostCenterRelationships()
Returns a List of CostCenterRelationships
|
java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> |
getDetailsRangesValidForQualifier()
Getter for the map of DIPI to List of Range's that are valid to be evaluated as qualifiers
|
java.util.Map |
getDetailsRangesValidForTarget()
map of DetailedItemPriceInfos to the list of ranges of each details that is available for discounting basic on the exclusion rules defined by various properties in Qualifier.
|
java.lang.Boolean |
getDiscountable()
Gets the current state of the discountable property for the filtered commerce item
|
java.lang.String |
getExternalId()
Returns property externalId.
|
java.lang.String |
getId()
Returns property Id
|
PaymentGroupRelationship |
getPaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
Returns the PaymentGroupRelationship whose id is pPaymentGroupRelationshipId.
|
int |
getPaymentGroupRelationshipCount()
Returns the number of PaymentGroupRelationships in the container.
|
java.util.List |
getPaymentGroupRelationships()
Returns a List of PaymentGroupRelationships
|
java.util.Map |
getPendingQuantityAsQualifierDetails()
linked hash map of DetailedItemPriceInfo objects to list of Range objects which state which
units of the details have acted as a qualifier.
|
ItemPriceInfo |
getPriceInfo()
Returns property PriceInfo
|
ItemPriceInfo |
getPriceQuote()
Gets the current running item price info for this pricing operation.
|
java.lang.Object |
getPropertyValue(java.lang.String pPropertyName)
Just in case the filtered commerce item has properties we don't explicitly
provide here, this method can be used.
|
long |
getQuantity()
Returns property Quantity
|
java.util.Map |
getQuantityAsQualifierDetails()
linked hash map of DetailedItemPriceInfo objects to list of Range objects which state which
units of the details have acted as a qualifier for something
|
double |
getQuantityDerivedAsFloatingPoint()
This method will return a derived quantity value which this CommerceItem object represents.
|
double |
getQuantityWithFraction()
Returns the quantity with fraction to add for a new commerce item
|
long |
getReturnedQuantity()
Returns the returnedQuantity
|
double |
getReturnedQuantityDerivedAsFloatingPoint()
This method will return a derived returned quantity value which this CommerceItem object represents.
|
double |
getReturnedQuantityWithFraction()
Returns the returned quantity
|
ShippingGroupRelationship |
getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId.
|
int |
getShippingGroupRelationshipCount()
Returns the number of ShippingGroupRelationships in the container.
|
java.util.List |
getShippingGroupRelationships()
Returns a List of ShippingGroupRelationships
|
int |
getState()
Returns property State
|
java.lang.String |
getStateDetail()
Returns property StateDetail
|
CommerceItem |
getWrappedItem() |
boolean |
isFractional()
This returns
true if quantityWithFraction property has
a value which is greater than zero, otherwise false is returned. |
void |
removeAllCostCenterRelationships()
Removes all the CostCenterRelationships
|
void |
removeAllPaymentGroupRelationships()
Removes all the PaymentGroupRelationships
|
void |
removeAllShippingGroupRelationships()
Removes all the ShippingGroupRelationships
|
CostCenterRelationship |
removeCostCenterRelationship(java.lang.String pCostCenterRelationshipId)
Removes a CostCenterRelationship whose id is passed in.
|
PaymentGroupRelationship |
removePaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
Removes a PaymentGroupRelationship whose id is passed in.
|
ShippingGroupRelationship |
removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
Removes a ShippingGroupRelationship whose id is passed in.
|
void |
setCatalogId(java.lang.String pCatalogId)
Sets property CatalogId
|
void |
setCatalogKey(java.lang.String pCatalogKey)
Sets property CatalogKey
|
void |
setCatalogRefId(java.lang.String pCatalogRefId)
Sets property CatalogRefId
|
void |
setCommerceItemClassType(java.lang.String pCommerceItemClassType)
Sets the commerceItemClassType
|
void |
setDetailsRangesValidForQualifier(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pDetailsRangesValidForQualifier)
Setter for the map of DIPI to List of Range's that are valid to be evaluated as qualifiers
|
void |
setDetailsRangesValidForTarget(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pDetailsRangesValidForTarget)
Setter for the map of DetailedItemPriceInfos to the list of ranges of each details that is available
for discounting.
|
void |
setDetailsRangesValidForTarget(java.util.Map pDetailsRangesValidForTarget)
Deprecated.
since we should use a LinkedHashMap to maintain order, see COMMERCE-168079,
replaced by
setDetailsRangesValidForTarget(LinkedHashMap) |
void |
setDiscountable(boolean pDiscountable)
Sets the property discountable for the filtered commerce item
|
void |
setExternalId(java.lang.String pExternalId)
Sets property externalId.
|
void |
setPendingQuantityAsQualifierDetails(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pPendingQuantityAsQualifierDetails)
linked hash map of DetailedItemPriceInfo objects to list of Range objects which state which
units of the details have acted as a qualifier for something
|
void |
setPriceInfo(ItemPriceInfo pPriceInfo)
Sets property PriceInfo
|
void |
setPriceQuote(ItemPriceInfo pPriceQuote)
Sets the current running item price info for this pricing operation.
|
void |
setPropertyValue(java.lang.String pPropertyName,
java.lang.Object pPropertyValue)
Just in case the filtered commerce item has properties we don't explicitly
provide here, this method can be used.
|
void |
setQuantity(long pQuantity)
Sets property Quantity
|
void |
setQuantityAsQualifierDetails(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pQuantityAsQualifierDetails)
linked hash map of DetailedItemPriceInfo objects to list of Range objects which state which
units of the details have acted as a qualifier for something
|
void |
setQuantityWithFraction(double pQuantityWithFraction)
Sets the quantity to add for a new fractional commerce item
|
void |
setState(int pState)
Sets property State
|
void |
setStateDetail(java.lang.String pStateDetail)
Sets property StateDetail
|
void |
setUsePriceQuote(boolean pUsePriceQuote) |
java.lang.String |
toString()
Generate a nice string.
|
boolean |
usePriceQuote() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getStateAsString
public static final long serialVersionUID
public static final java.lang.String CLASS_VERSION
public static final java.lang.String QUANTITY_PROPERTY_NAME
public static final java.lang.String QUANTITY_WITH_FRACTION_PROPERTY_NAME
public static final java.lang.String QUANTITY_AS_QUALIFIER_DETAILS
public static final java.lang.String DETAILS_RANGES_VALID_FOR_TARGET
public static final java.lang.String WRAPPED_ITEM
public static final java.lang.String PRICE_INFO
protected java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> mDetailsRangesValidForQualifier
public FilteredCommerceItem(CommerceItem pItem)
pItem
- public java.lang.Boolean getDiscountable()
public void setDiscountable(boolean pDiscountable)
pDiscountable
- public ItemPriceInfo getPriceQuote()
public void setPriceQuote(ItemPriceInfo pPriceQuote)
pPriceQuote
- ItemPriceInfopublic boolean usePriceQuote()
public void setUsePriceQuote(boolean pUsePriceQuote)
public java.util.Map getQuantityAsQualifierDetails()
public void setQuantityAsQualifierDetails(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pQuantityAsQualifierDetails)
pQuantityAsQualifierDetails
- public java.util.Map getPendingQuantityAsQualifierDetails()
public void setPendingQuantityAsQualifierDetails(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pPendingQuantityAsQualifierDetails)
pPendingQuantityAsQualifierDetails
- public java.util.Map getDetailsRangesValidForTarget()
The map should be a LinkedHashMap to maintain order of the entries, see COMMERCE-168079.
@Deprecated public void setDetailsRangesValidForTarget(java.util.Map pDetailsRangesValidForTarget)
setDetailsRangesValidForTarget(LinkedHashMap)
The map should be a LinkedHashMap to maintain order of the entries, see COMMERCE-168079.
public void setDetailsRangesValidForTarget(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pDetailsRangesValidForTarget)
The map should be a LinkedHashMap to maintain order of the entries, see COMMERCE-168079.
public java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> getDetailsRangesValidForQualifier()
public void setDetailsRangesValidForQualifier(java.util.LinkedHashMap<DetailedItemPriceInfo,java.util.List<atg.core.util.Range>> pDetailsRangesValidForQualifier)
pDetailsRangesValidForQualifier
- Map of DIPI to List of Range's that are valid to be evaluated as qualifierspublic CommerceItem getWrappedItem()
public void setQuantity(long pQuantity)
setQuantity
in interface CommerceItem
pQuantity
- quantity (of non-fractional item).public long getQuantity()
getQuantity
in interface CommerceItem
public void setQuantityWithFraction(double pQuantityWithFraction)
setQuantityWithFraction
in interface CommerceItem
pQuantityWithFraction
- quantity (of fractional item).public double getQuantityWithFraction()
getQuantityWithFraction
in interface CommerceItem
double
value.public double getQuantityDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non null
value from the properties, quantityWithFraction
, quantity
, in that order.
The method should be used where there is a need to know the quantity of an item
but it is unknown to the caller as to which property (quantityWithFraction
or
quantity
holds the value.
getQuantityDerivedAsFloatingPoint
in interface CommerceItem
public boolean isFractional()
true
if quantityWithFraction property has
a value which is greater than zero, otherwise false
is returned.isFractional
in interface CommerceItem
boolean
value.public java.lang.String getId()
getId
in interface CommerceIdentifier
public void setExternalId(java.lang.String pExternalId)
setExternalId
in interface CommerceItem
public java.lang.String getExternalId()
getExternalId
in interface CommerceItem
public void setCommerceItemClassType(java.lang.String pCommerceItemClassType)
setCommerceItemClassType
in interface CommerceItem
pCommerceItemClassType
- public java.lang.String getCommerceItemClassType()
getCommerceItemClassType
in interface CommerceItem
public void setCatalogKey(java.lang.String pCatalogKey)
setCatalogKey
in interface CommerceItem
pCatalogKey
- public java.lang.String getCatalogKey()
getCatalogKey
in interface CommerceItem
public void setCatalogId(java.lang.String pCatalogId)
setCatalogId
in interface CommerceItem
pCatalogId
- public java.lang.String getCatalogId()
getCatalogId
in interface CommerceItem
public void setCatalogRefId(java.lang.String pCatalogRefId)
setCatalogRefId
in interface CommerceItem
pCatalogRefId
- public java.lang.String getCatalogRefId()
getCatalogRefId
in interface CommerceItem
public long getReturnedQuantity()
getReturnedQuantity
in interface CommerceItem
public double getReturnedQuantityWithFraction()
getReturnedQuantityWithFraction
in interface CommerceItem
public double getReturnedQuantityDerivedAsFloatingPoint()
It will decide upon the correct returned quantity value to return, returning the first non zero
value from the properties, returnedQuantityWithFraction
, returnedQantity
, in that order.
The method should be used where there is a need to know the returned quantity of an item
but it is unknown to the caller as to which property (returnedQuantityWithFraction
or
returnedQantity
holds the value.
getReturnedQuantityDerivedAsFloatingPoint
in interface CommerceItem
public void setState(int pState)
setState
in interface CommerceItem
pState
- public int getState()
getState
in interface CommerceItem
public void setStateDetail(java.lang.String pStateDetail)
setStateDetail
in interface CommerceItem
pStateDetail
- public java.lang.String getStateDetail()
getStateDetail
in interface CommerceItem
public void setPriceInfo(ItemPriceInfo pPriceInfo)
setPriceInfo
in interface CommerceItem
pPriceInfo
- public ItemPriceInfo getPriceInfo()
getPriceInfo
in interface CommerceItem
public AuxiliaryData getAuxiliaryData()
getAuxiliaryData
in interface CommerceItem
public java.util.List getShippingGroupRelationships()
getShippingGroupRelationships
in interface ShippingGroupRelationshipContainer
public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship) throws DuplicateRelationshipException, InvalidParameterException
addShippingGroupRelationship
in interface ShippingGroupRelationshipContainer
pShippingGroupRelationship
- the ShippingRelationshipGroup to be addedDuplicateRelationshipException
InvalidParameterException
public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship, int pIndex) throws DuplicateRelationshipException, InvalidParameterException
addShippingGroupRelationship
in interface ShippingGroupRelationshipContainer
pShippingGroupRelationship
- The ShippingGroupRelationship to be addedpIndex
- the index in the container that this ShippingGroupRelationship will be addedDuplicateRelationshipException
InvalidParameterException
public ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId) throws RelationshipNotFoundException, InvalidParameterException
removeShippingGroupRelationship
in interface ShippingGroupRelationshipContainer
pShippingGroupRelationshipId
- the Id of the ShippingGroupRelationshipRelationshipNotFoundException
InvalidParameterException
public void removeAllShippingGroupRelationships()
removeAllShippingGroupRelationships
in interface ShippingGroupRelationshipContainer
public ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId) throws RelationshipNotFoundException, InvalidParameterException
getShippingGroupRelationship
in interface ShippingGroupRelationshipContainer
pShippingGroupRelationshipId
- The Id of the ShippingGroupRelationshipRelationshipNotFoundException
InvalidParameterException
public int getShippingGroupRelationshipCount()
getShippingGroupRelationshipCount
in interface ShippingGroupRelationshipContainer
public java.util.List getPaymentGroupRelationships()
getPaymentGroupRelationships
in interface PaymentGroupRelationshipContainer
public void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship) throws DuplicateRelationshipException, InvalidParameterException
addPaymentGroupRelationship
in interface PaymentGroupRelationshipContainer
pPaymentGroupRelationship
- the PaymentRelationshipGroup to be addedDuplicateRelationshipException
InvalidParameterException
public void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship, int pIndex) throws DuplicateRelationshipException, InvalidParameterException
addPaymentGroupRelationship
in interface PaymentGroupRelationshipContainer
pPaymentGroupRelationship
- The PaymentGroupRelationship to be addedpIndex
- the index in the container that this PaymentGroupRelationship will be addedDuplicateRelationshipException
InvalidParameterException
public PaymentGroupRelationship removePaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId) throws RelationshipNotFoundException, InvalidParameterException
removePaymentGroupRelationship
in interface PaymentGroupRelationshipContainer
pPaymentGroupRelationshipId
- the Id of the PaymentFroupRelationshipRelationshipNotFoundException
InvalidParameterException
public void removeAllPaymentGroupRelationships()
removeAllPaymentGroupRelationships
in interface PaymentGroupRelationshipContainer
public PaymentGroupRelationship getPaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId) throws RelationshipNotFoundException, InvalidParameterException
getPaymentGroupRelationship
in interface PaymentGroupRelationshipContainer
pPaymentGroupRelationshipId
- - the Id of the PaymentGroupRelationshipRelationshipNotFoundException
InvalidParameterException
public int getPaymentGroupRelationshipCount()
getPaymentGroupRelationshipCount
in interface PaymentGroupRelationshipContainer
public java.util.List getCostCenterRelationships()
getCostCenterRelationships
in interface CostCenterRelationshipContainer
public void addCostCenterRelationship(CostCenterRelationship pCostCenterRelationship) throws DuplicateRelationshipException, InvalidParameterException
addCostCenterRelationship
in interface CostCenterRelationshipContainer
DuplicateRelationshipException
InvalidParameterException
public void addCostCenterRelationship(CostCenterRelationship pCostCenterRelationship, int pIndex) throws DuplicateRelationshipException, InvalidParameterException
addCostCenterRelationship
in interface CostCenterRelationshipContainer
DuplicateRelationshipException
InvalidParameterException
public CostCenterRelationship removeCostCenterRelationship(java.lang.String pCostCenterRelationshipId) throws RelationshipNotFoundException, InvalidParameterException
removeCostCenterRelationship
in interface CostCenterRelationshipContainer
RelationshipNotFoundException
InvalidParameterException
public void removeAllCostCenterRelationships()
removeAllCostCenterRelationships
in interface CostCenterRelationshipContainer
public CostCenterRelationship getCostCenterRelationship(java.lang.String pCostCenterRelationshipId) throws RelationshipNotFoundException, InvalidParameterException
getCostCenterRelationship
in interface CostCenterRelationshipContainer
RelationshipNotFoundException
InvalidParameterException
public int getCostCenterRelationshipCount()
getCostCenterRelationshipCount
in interface CostCenterRelationshipContainer
public java.lang.Object getPropertyValue(java.lang.String pPropertyName) throws PropertyNotFoundException
pPropertyName
- The name of the commerce item propertyPropertyNotFoundException
public void setPropertyValue(java.lang.String pPropertyName, java.lang.Object pPropertyValue) throws PropertyNotFoundException
pPropertyName
- The name of the commerce item propertypPropertyValue
- The value to set the property toPropertyNotFoundException
public java.lang.String toString()
toString
in class java.lang.Object
CommerceItemImpl.toString()
public FilteredCommerceItem clone()
clone
in class java.lang.Object