| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.elasticpath.sfweb.ajax.bean.impl.CartItemBeanImpl
public class CartItemBeanImpl
A wrapper class for cart items sent through dwr.
| Field Summary | |
|---|---|
| static long | serialVersionUIDSerial version id. | 
| Constructor Summary | |
|---|---|
| CartItemBeanImpl(CartItem cartItem,
                 java.util.Currency currency,
                 java.util.Locale locale)Creates a new dwr CartItemBean wrapper for a CartItem. | |
| Method Summary | |
|---|---|
|  void | addDependentCartItem(CartItem dependentCartItem)Specify that another cart item depends on this cart item. | 
|  void | applyDiscount(java.math.BigDecimal amount)Adds a discount amount to this cart item. | 
|  void | clearDiscount()Removes previously applied CartItem discounts. | 
|  void | executeBeforePersistAction()Interceptor to perform tasks before persisting changes. | 
|  java.math.BigDecimal | getAmount(java.util.Currency currency)Get the total price of this shopping cart item. | 
|  Money | getAmountMoney(java.util.Currency currency)Get the amount as a Moneyobject. | 
|  CartItem | getCartItem() | 
|  java.util.Currency | getCurrency() | 
|  java.util.Set | getDependentCartItems()Get the set of dependent cart items. | 
|  java.lang.String | getDisplayName()Convenience method for getting the product's localized display name. | 
|  ElasticPath | getElasticPath()Get the ElasticPath singleton. | 
|  boolean | getHasDependentCartItems()Returns true if this CartItem has other cart items that depend on it such that the dependent items cannot exist in the cart on their own. | 
|  java.lang.String | getListPrice()Convenience method for getting the ProductSku list price. | 
|  java.util.Locale | getLocale() | 
|  java.lang.String | getLowestPrice()Convenience method for getting the lowest ProductSku price. | 
|  CartItem | getParentCartItem()Get the parent cart item that this cart item is dependent on. | 
|  long | getParentCartItemUidPk()Get the uidPk of the parent cart item that this cart item is dependent on. | 
|  java.lang.String | getProductBrandName()Convenience method for getting the product's seo url. | 
|  java.lang.String | getProductSeoUrl()Convenience method for getting the product's seo url. | 
|  ProductSku | getProductSku()Get the product SKU corresponding to this item in a cart. | 
|  int | getQuantity()Get the quantity of this item as a primitive int. | 
|  java.lang.String | getSavings()Convenience method for getting the amount of money saved. | 
|  java.lang.String | getTotalPrice()Convenience method for getting the amount without needing to pass in the currency. | 
|  java.lang.String | getType()Get the type of action, i.e. | 
|  long | getUidPk()Gets the unique identifier for the cart item object. | 
|  boolean | hasDependentCartItem(java.lang.String skuCode)Returns true if this CartItem has another cart items that depend on it which matches the supplied skuCode. | 
|  boolean | hasDependentCartItems()Returns true if this CartItem has other cart items that depend on it such that the dependent items cannot exist in the cart on their own. | 
|  boolean | hasSufficientInventory()Returns true if there is sufficent stock to sell this cart item (in the quantity set in the CartItem). | 
|  boolean | isDependent()Returns true if this CartItem depends on another cart item such that it can't exist in the cart on its own. | 
|  boolean | isLowestLessThanList()Convenience method for checking if item is on sale. | 
|  boolean | isPersistent()True if the cart item has previously been persisted. | 
|  void | setCurrency(java.util.Currency currency) | 
|  void | setDefaultValues()Set default values for those fields that need default values. | 
|  void | setDependentCartItems(java.util.Set dependentCartItems)Set the set of dependent cart items. | 
|  void | setElasticPath(ElasticPath elasticpath)Inject the ElasticPath singleton. | 
|  void | setLocale(java.util.Locale locale) | 
|  void | setParentCartItem(CartItem parentCartItem)Set the parent cart item that this cart item is dependent on. | 
|  void | setProductSku(ProductSku productSku)Set the product SKU corresponding to this item in a cart. | 
|  void | setQuantity(int quantity)Set the quantity of this item as a primitive int. | 
|  void | setType(java.lang.String type)Set the type of action. | 
|  void | setUidPk(long uidPk)Sets the unique identifier for the cart item object. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final long serialVersionUID
| Constructor Detail | 
|---|
public CartItemBeanImpl(CartItem cartItem,
                        java.util.Currency currency,
                        java.util.Locale locale)
CartItem.
cartItem - the cart item to be wrappedcurrency - the current currencylocale - the current locale| Method Detail | 
|---|
public void addDependentCartItem(CartItem dependentCartItem)
addDependentCartItem in interface CartItemdependentCartItem - the other, dependent cart itempublic void applyDiscount(java.math.BigDecimal amount)
applyDiscount in interface CartItemamount - the amount to discountpublic void clearDiscount()
clearDiscount in interface CartItempublic void executeBeforePersistAction()
executeBeforePersistAction in interface Persistencepublic java.math.BigDecimal getAmount(java.util.Currency currency)
getAmount in interface CartItemcurrency - the currency of the total price to be returned
BigDecimal object representing the total pricepublic Money getAmountMoney(java.util.Currency currency)
Money object.
getAmountMoney in interface CartItemcurrency - the currency of the total price to be returned
Money object representing the total pricepublic CartItem getCartItem()
getCartItem in interface CartItemBeanpublic java.util.Currency getCurrency()
getCurrency in interface CartItemBeanpublic java.util.Set getDependentCartItems()
getDependentCartItems in interface CartItempublic java.lang.String getDisplayName()
getDisplayName in interface CartItemBeanpublic ElasticPath getElasticPath()
getElasticPath in interface EpDomainpublic boolean getHasDependentCartItems()
getHasDependentCartItems in interface CartItemBeanpublic java.lang.String getListPrice()
getListPrice in interface CartItemBeanpublic java.util.Locale getLocale()
getLocale in interface CartItemBeanpublic java.lang.String getLowestPrice()
getLowestPrice in interface CartItemBeanpublic CartItem getParentCartItem()
getParentCartItem in interface CartItempublic long getParentCartItemUidPk()
getParentCartItemUidPk in interface CartItemBeanpublic java.lang.String getProductBrandName()
getProductBrandName in interface CartItemBeanpublic java.lang.String getProductSeoUrl()
getProductSeoUrl in interface CartItemBeanpublic ProductSku getProductSku()
getProductSku in interface CartItemProductSKUpublic int getQuantity()
getQuantity in interface CartItempublic java.lang.String getSavings()
getSavings in interface CartItemBeanpublic java.lang.String getTotalPrice()
getTotalPrice in interface CartItemBeanpublic java.lang.String getType()
CartItem
getType in interface CartItempublic long getUidPk()
getUidPk in interface Persistencepublic boolean hasDependentCartItem(java.lang.String skuCode)
hasDependentCartItem in interface CartItemskuCode - The GUID of the particular dependant SKU to be in the cart.
public boolean hasDependentCartItems()
hasDependentCartItems in interface CartItempublic boolean hasSufficientInventory()
hasSufficientInventory in interface CartItempublic boolean isDependent()
isDependent in interface CartItempublic boolean isLowestLessThanList()
isLowestLessThanList in interface CartItemBeanpublic boolean isPersistent()
isPersistent in interface Persistencepublic void setCurrency(java.util.Currency currency)
setCurrency in interface CartItemBeancurrency - the currency to setpublic void setDefaultValues()
setDefaultValues in interface Persistencepublic void setDependentCartItems(java.util.Set dependentCartItems)
setDependentCartItems in interface CartItemdependentCartItems - the set of dependent cart items.public void setElasticPath(ElasticPath elasticpath)
setElasticPath in interface EpDomainelasticpath - the ElasticPath singleton.public void setLocale(java.util.Locale locale)
setLocale in interface CartItemBeanlocale - the locale to setpublic void setParentCartItem(CartItem parentCartItem)
setParentCartItem in interface CartItemparentCartItem - the parent cart item.public void setProductSku(ProductSku productSku)
setProductSku in interface CartItemproductSku - the ProductSKUpublic void setQuantity(int quantity)
setQuantity in interface CartItemquantity - the quantitypublic void setType(java.lang.String type)
CartItem
setType in interface CartItemtype - the cart item typepublic void setUidPk(long uidPk)
setUidPk in interface PersistenceuidPk - the new unique identifier.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||