atg.commerce.catalog.comparison
Class ProductComparisonList.Entry

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by atg.commerce.catalog.comparison.ProductComparisonList.Entry
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map
Enclosing class:
ProductComparisonList

public static class ProductComparisonList.Entry
extends java.util.HashMap

Entry is specifically designed for comparing catalog-based category/product/sku tuples rather than simple Java objects.

Entry will always contain at least the following set of properties:

See Also:
Serialized Form

Nested Class Summary
static class ProductComparisonList.Entry.InventoryData
          Inner class to capture and hold inventory data; returns the same readable properties as atg.commerce.inventory.InventoryInfo, but is serializable so it can participate in session failover.
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
ProductComparisonList.Entry()
          Create a new Entry and store its id in the hashtable so that entry.id works from jhtml pages.
 
Method Summary
protected  boolean compareItems(RepositoryItem thisValue, RepositoryItem thatValue)
          Compare two repository items for equality, allowing for null values.
protected  boolean compareObjects(java.lang.Object thisValue, java.lang.Object thatValue)
          Compare two objects for equality, allowing for null values.
 boolean equals(java.lang.Object pObj)
          Compare two Entries for equality, where equality is defined as both Entries having the same category, product, and sku.
 RepositoryItem getCategory()
          Get the category for this comparison list entry.
 java.lang.String getCategoryLink()
          Get the HTML that links to the category page for this comparison list entry.
 int getId()
          Get an id that uniquely identifies this particular list entry.
 ProductComparisonList.Entry.InventoryData getInventoryInfo()
          Get the InventoryData object for this comparison list entry.
 ItemPriceInfo getPriceInfo()
          Get the ItemPriceInfo object for this comparison list entry.
 RepositoryItem getProduct()
          Get the product for this comparison list entry.
 java.lang.String getProductLink()
          Get the HTML that links to the product page for this comparison list entry.
 java.lang.String getSiteId()
          Get the site id for this comparison list entry.
 RepositoryItem getSku()
          Get the SKU for this comparison list entry.
protected  boolean match(RepositoryItem pProduct, RepositoryItem pCategory, RepositoryItem pSku, java.lang.String pSiteId)
          Compares entry's product, category, sku, and site id with pProduct, pCategory, pSku, and pSiteID accordingly.
protected  boolean match(java.lang.String pProductId, java.lang.String pCategoryId, java.lang.String pSkuId, java.lang.String pSiteID)
          Compares entry's product id, category id, sku id, site id with pProductId, pCategoryId, pSkuId, pSiteID accordingly
 void setCategory(RepositoryItem pCategory)
          Set the category for this comparison list entry.
 void setCategoryLink(java.lang.String pHTML)
          Set the HTML that links to the category page for this comparison list entry.
 void setInventoryFrom(InventoryInfo pInfo)
          Set the InventoryData object for this comparison list entry using an InventoryInfo object as an exemplar.
 void setInventoryInfo(ProductComparisonList.Entry.InventoryData pInfo)
          Set the InventoryData object for this comparison list entry.
 void setPriceInfo(ItemPriceInfo pPrice)
          Set the ItemPriceInfo object for this comparison list entry.
 void setProduct(RepositoryItem pProduct)
          Set the product for this comparison list entry.
 void setProductLink(java.lang.String pHTML)
          Set the HTML that links to the product page for this comparison list entry.
 void setSiteId(java.lang.String pSiteId)
          Set the site id for this comparison list entry.
 void setSku(RepositoryItem pSku)
          Set the SKU for this comparison list entry.
 java.lang.String toString()
          Return a string representation of this Entry for debugging purposes.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Constructor Detail

ProductComparisonList.Entry

public ProductComparisonList.Entry()
Create a new Entry and store its id in the hashtable so that entry.id works from jhtml pages. Entry

Method Detail

getProduct

public RepositoryItem getProduct()
Get the product for this comparison list entry.


setProduct

public void setProduct(RepositoryItem pProduct)
Set the product for this comparison list entry.


getProductLink

public java.lang.String getProductLink()
Get the HTML that links to the product page for this comparison list entry.


setProductLink

public void setProductLink(java.lang.String pHTML)
Set the HTML that links to the product page for this comparison list entry.


getCategory

public RepositoryItem getCategory()
Get the category for this comparison list entry.


setCategory

public void setCategory(RepositoryItem pCategory)
Set the category for this comparison list entry.


getCategoryLink

public java.lang.String getCategoryLink()
Get the HTML that links to the category page for this comparison list entry.


setCategoryLink

public void setCategoryLink(java.lang.String pHTML)
Set the HTML that links to the category page for this comparison list entry.


getSku

public RepositoryItem getSku()
Get the SKU for this comparison list entry.


setSku

public void setSku(RepositoryItem pSku)
Set the SKU for this comparison list entry.


getSiteId

public java.lang.String getSiteId()
Get the site id for this comparison list entry.


setSiteId

public void setSiteId(java.lang.String pSiteId)
Set the site id for this comparison list entry.


setInventoryFrom

public void setInventoryFrom(InventoryInfo pInfo)
Set the InventoryData object for this comparison list entry using an InventoryInfo object as an exemplar.


setInventoryInfo

public void setInventoryInfo(ProductComparisonList.Entry.InventoryData pInfo)
Set the InventoryData object for this comparison list entry.


getInventoryInfo

public ProductComparisonList.Entry.InventoryData getInventoryInfo()
Get the InventoryData object for this comparison list entry.


setPriceInfo

public void setPriceInfo(ItemPriceInfo pPrice)
Set the ItemPriceInfo object for this comparison list entry.


getPriceInfo

public ItemPriceInfo getPriceInfo()
Get the ItemPriceInfo object for this comparison list entry.


getId

public int getId()
Get an id that uniquely identifies this particular list entry.


equals

public boolean equals(java.lang.Object pObj)
Compare two Entries for equality, where equality is defined as both Entries having the same category, product, and sku.

Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.util.AbstractMap

match

protected boolean match(java.lang.String pProductId,
                        java.lang.String pCategoryId,
                        java.lang.String pSkuId,
                        java.lang.String pSiteID)
Compares entry's product id, category id, sku id, site id with pProductId, pCategoryId, pSkuId, pSiteID accordingly

Parameters:
pProductId - product id
pCategoryId - category id
pSkuId - sku id
pSiteID - site id
Returns:
Entry's attributes match passed parameters.

match

protected boolean match(RepositoryItem pProduct,
                        RepositoryItem pCategory,
                        RepositoryItem pSku,
                        java.lang.String pSiteId)
Compares entry's product, category, sku, and site id with pProduct, pCategory, pSku, and pSiteID accordingly.

Parameters:
pProduct - product repository item
pCategory - category repository item
pSku - SKU repository item
pSiteId - site Id
Returns:
true if Entry's attributes match passed parameters, otherwise false

compareObjects

protected boolean compareObjects(java.lang.Object thisValue,
                                 java.lang.Object thatValue)
Compare two objects for equality, allowing for null values.


compareItems

protected boolean compareItems(RepositoryItem thisValue,
                               RepositoryItem thatValue)
Compare two repository items for equality, allowing for null values.


toString

public java.lang.String toString()
Return a string representation of this Entry for debugging purposes.

Overrides:
toString in class java.util.AbstractMap