atg.commerce.pricing
Class FilteredCommerceItem

java.lang.Object
  extended by atg.commerce.pricing.FilteredCommerceItem
All Implemented Interfaces:
CommerceIdentifier, CommerceItem, PaymentGroupRelationshipContainer, ShippingGroupRelationshipContainer, java.io.Serializable

public class FilteredCommerceItem
extends java.lang.Object
implements CommerceItem

Represents a CommerceItem that's currently participating in a rules evaluation in the Qualifier. This object holds a reference to the object it is wrapping:

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:

See Also:
CommerceItem, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DETAILS_RANGES_VALID_FOR_TARGET
           
static java.lang.String QUANTITY_AS_QUALIFIER_DETAILS
           
static java.lang.String QUANTITY_PROPERTY_NAME
           
static java.lang.String WRAPPED_ITEM
           
 
Constructor Summary
FilteredCommerceItem(CommerceItem pItem)
          Constructs an instanceof PricingCommerceItem
 
Method Summary
 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.
 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
 java.util.Map getDetailsRangesValidForTarget()
          map of DetailedItemPriceInfos to the number of each details that is available for discounting basic on the exclusion rules defined by various properties in Qualifier
 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
 ItemPriceInfo getPriceInfo()
          Returns property PriceInfo
 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()
          map of DetailedItemPriceInfo objects to Range objects which state which units of the details have acted as a qualifier for something
 long getReturnedQuantity()
          Returns the returnedQuantity
 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()
           
 void removeAllPaymentGroupRelationships()
          Removes all the PaymentGroupRelationships
 void removeAllShippingGroupRelationships()
          Removes all the ShippingGroupRelationships
 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 setPriceInfo(ItemPriceInfo pPriceInfo)
          Sets property PriceInfo
 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 setState(int pState)
          Sets property State
 void setStateDetail(java.lang.String pStateDetail)
          Sets property StateDetail
 java.lang.String toString()
          Generate a nice string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

QUANTITY_PROPERTY_NAME

public static final java.lang.String QUANTITY_PROPERTY_NAME
See Also:
Constant Field Values

QUANTITY_AS_QUALIFIER_DETAILS

public static final java.lang.String QUANTITY_AS_QUALIFIER_DETAILS
See Also:
Constant Field Values

DETAILS_RANGES_VALID_FOR_TARGET

public static final java.lang.String DETAILS_RANGES_VALID_FOR_TARGET
See Also:
Constant Field Values

WRAPPED_ITEM

public static final java.lang.String WRAPPED_ITEM
See Also:
Constant Field Values
Constructor Detail

FilteredCommerceItem

public FilteredCommerceItem(CommerceItem pItem)
Constructs an instanceof PricingCommerceItem

Parameters:
pItem -
Method Detail

getQuantityAsQualifierDetails

public java.util.Map getQuantityAsQualifierDetails()
map of DetailedItemPriceInfo objects to Range objects which state which units of the details have acted as a qualifier for something

Returns:
property QuantityAsQualifierDetails

getDetailsRangesValidForTarget

public java.util.Map getDetailsRangesValidForTarget()
map of DetailedItemPriceInfos to the number of each details that is available for discounting basic on the exclusion rules defined by various properties in Qualifier

Returns:
property DetailsRangesValidForTarget

getWrappedItem

public CommerceItem getWrappedItem()
Returns:
property WrappedItem

setQuantity

public void setQuantity(long pQuantity)
Sets property Quantity

Specified by:
setQuantity in interface CommerceItem
Parameters:
pQuantity -

getQuantity

public long getQuantity()
Returns property Quantity

Specified by:
getQuantity in interface CommerceItem
Returns:
The property Quantity

getId

public java.lang.String getId()
Returns property Id

Specified by:
getId in interface CommerceIdentifier
Returns:
The property Id

setCommerceItemClassType

public void setCommerceItemClassType(java.lang.String pCommerceItemClassType)
Sets the commerceItemClassType

Specified by:
setCommerceItemClassType in interface CommerceItem
Parameters:
pCommerceItemClassType -

getCommerceItemClassType

public java.lang.String getCommerceItemClassType()
Returns the commerceItemClassType

Specified by:
getCommerceItemClassType in interface CommerceItem
Returns:
The commerceItemClassType

setCatalogKey

public void setCatalogKey(java.lang.String pCatalogKey)
Sets property CatalogKey

Specified by:
setCatalogKey in interface CommerceItem
Parameters:
pCatalogKey -

getCatalogKey

public java.lang.String getCatalogKey()
Returns property CatalogKey

Specified by:
getCatalogKey in interface CommerceItem
Returns:
The property CatalogKey

setCatalogId

public void setCatalogId(java.lang.String pCatalogId)
Sets property CatalogId

Specified by:
setCatalogId in interface CommerceItem
Parameters:
pCatalogId -

getCatalogId

public java.lang.String getCatalogId()
Returns property CatalogId

Specified by:
getCatalogId in interface CommerceItem
Returns:
The property CatalogId

setCatalogRefId

public void setCatalogRefId(java.lang.String pCatalogRefId)
Sets property CatalogRefId

Specified by:
setCatalogRefId in interface CommerceItem
Parameters:
pCatalogRefId -

getCatalogRefId

public java.lang.String getCatalogRefId()
Returns property CatalogRefId

Specified by:
getCatalogRefId in interface CommerceItem
Returns:
The property CatalogRefId

getReturnedQuantity

public long getReturnedQuantity()
Returns the returnedQuantity

Specified by:
getReturnedQuantity in interface CommerceItem
Returns:
The ReturnedQuantity

setState

public void setState(int pState)
Sets property State

Specified by:
setState in interface CommerceItem
Parameters:
pState -

getState

public int getState()
Returns property State

Specified by:
getState in interface CommerceItem
Returns:
The property State

setStateDetail

public void setStateDetail(java.lang.String pStateDetail)
Sets property StateDetail

Specified by:
setStateDetail in interface CommerceItem
Parameters:
pStateDetail -

getStateDetail

public java.lang.String getStateDetail()
Returns property StateDetail

Specified by:
getStateDetail in interface CommerceItem
Returns:
The perperty StateDetail

setPriceInfo

public void setPriceInfo(ItemPriceInfo pPriceInfo)
Sets property PriceInfo

Specified by:
setPriceInfo in interface CommerceItem
Parameters:
pPriceInfo -

getPriceInfo

public ItemPriceInfo getPriceInfo()
Returns property PriceInfo

Specified by:
getPriceInfo in interface CommerceItem
Returns:
The PriceInfo

getAuxiliaryData

public AuxiliaryData getAuxiliaryData()
returns the AuxiliaryData.

Specified by:
getAuxiliaryData in interface CommerceItem
Returns:
The AuxiliaryData

getShippingGroupRelationships

public java.util.List getShippingGroupRelationships()
Returns a List of ShippingGroupRelationships

Specified by:
getShippingGroupRelationships in interface ShippingGroupRelationshipContainer
Returns:
The list of the ShippingGroupRelationships

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Parameters:
pShippingGroupRelationship - the ShippingRelationshipGroup to be added
Throws:
DuplicateRelationshipException
InvalidParameterException

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship,
                                         int pIndex)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container at the given index. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Parameters:
pShippingGroupRelationship - The ShippingGroupRelationship to be added
pIndex - the index in the container that this ShippingGroupRelationship will be added
Throws:
DuplicateRelationshipException
InvalidParameterException

removeShippingGroupRelationship

public ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                          throws RelationshipNotFoundException,
                                                                 InvalidParameterException
Removes a ShippingGroupRelationship whose id is passed in. If the ShippingGroupRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed ShippingGroupRelationship is returned.

Specified by:
removeShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Parameters:
pShippingGroupRelationshipId - the Id of the ShippingGroupRelationship
Returns:
The ShippingGroupRelationship that has been removed
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllShippingGroupRelationships

public void removeAllShippingGroupRelationships()
Removes all the ShippingGroupRelationships

Specified by:
removeAllShippingGroupRelationships in interface ShippingGroupRelationshipContainer

getShippingGroupRelationship

public ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                       throws RelationshipNotFoundException,
                                                              InvalidParameterException
Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId. If theShippingGroupRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Parameters:
pShippingGroupRelationshipId - The Id of the ShippingGroupRelationship
Returns:
The ShippingGroupRelationship
Throws:
RelationshipNotFoundException
InvalidParameterException

getShippingGroupRelationshipCount

public int getShippingGroupRelationshipCount()
Returns the number of ShippingGroupRelationships in the container.

Specified by:
getShippingGroupRelationshipCount in interface ShippingGroupRelationshipContainer
Returns:
the number of ShippingGroupRelationships in the container

getPaymentGroupRelationships

public java.util.List getPaymentGroupRelationships()
Returns a List of PaymentGroupRelationships

Specified by:
getPaymentGroupRelationships in interface PaymentGroupRelationshipContainer
Returns:
The list of the PaymentGroupRelationships

addPaymentGroupRelationship

public void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the PaymentGroupRelationship to the container. If the PaymentGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addPaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Parameters:
pPaymentGroupRelationship - the PaymentRelationshipGroup to be added
Throws:
DuplicateRelationshipException
InvalidParameterException

addPaymentGroupRelationship

public void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship,
                                        int pIndex)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the PaymentGroupRelationship to the container at the given index. If the PaymentGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addPaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Parameters:
pPaymentGroupRelationship - The PaymentGroupRelationship to be added
pIndex - the index in the container that this PaymentGroupRelationship will be added
Throws:
DuplicateRelationshipException
InvalidParameterException

removePaymentGroupRelationship

public PaymentGroupRelationship removePaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
                                                        throws RelationshipNotFoundException,
                                                               InvalidParameterException
Removes a PaymentGroupRelationship whose id is passed in. If the PaymentGroupRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed PaymentGroupRelationship is returned.

Specified by:
removePaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Parameters:
pPaymentGroupRelationshipId - the Id of the PaymentFroupRelationship
Returns:
The PaymentGroupRelationship that has been removed
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllPaymentGroupRelationships

public void removeAllPaymentGroupRelationships()
Removes all the PaymentGroupRelationships

Specified by:
removeAllPaymentGroupRelationships in interface PaymentGroupRelationshipContainer

getPaymentGroupRelationship

public PaymentGroupRelationship getPaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
                                                     throws RelationshipNotFoundException,
                                                            InvalidParameterException
Returns the PaymentGroupRelationship whose id is pPaymentGroupRelationshipId. If thePaymentGroupRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getPaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Parameters:
pPaymentGroupRelationshipId - - the Id of the PaymentGroupRelationship
Returns:
The PaymentGroupRelationship
Throws:
RelationshipNotFoundException
InvalidParameterException

getPaymentGroupRelationshipCount

public int getPaymentGroupRelationshipCount()
Returns the number of PaymentGroupRelationships in the container.

Specified by:
getPaymentGroupRelationshipCount in interface PaymentGroupRelationshipContainer
Returns:
the number of PaymentGroupRelationships in the container

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String pPropertyName)
                                  throws PropertyNotFoundException
Just in case the filtered commerce item has properties we don't explicitly provide here, this method can be used.

Parameters:
pPropertyName - The name of the commerce item property
Returns:
the value of the given property in the filtered item
Throws:
PropertyNotFoundException

setPropertyValue

public void setPropertyValue(java.lang.String pPropertyName,
                             java.lang.Object pPropertyValue)
                      throws PropertyNotFoundException
Just in case the filtered commerce item has properties we don't explicitly provide here, this method can be used.

Parameters:
pPropertyName - The name of the commerce item property
pPropertyValue - The value to set the property to
Throws:
PropertyNotFoundException

toString

public java.lang.String toString()
Generate a nice string. Uses CommerceItem.toString

Overrides:
toString in class java.lang.Object
See Also:
CommerceItemImpl.toString()