|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.elasticpath.domain.impl.AbstractEpDomainImpl
com.elasticpath.domain.impl.AbstractPersistenceImpl
com.elasticpath.domain.impl.AbstractValueObjectImpl
com.elasticpath.domain.shoppingcart.impl.AbstractCartItemImpl
public abstract class AbstractCartItemImpl
A CartItem represents a quantity of SKUs in a shopping cart, saved cart, wish list, etc.
| Field Summary | |
|---|---|
static long |
serialVersionUID
Serial version id. |
| Constructor Summary | |
|---|---|
AbstractCartItemImpl()
|
|
| 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. |
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 Money object. |
java.util.Set |
getDependentCartItems()
Get the set of dependent cart items. |
CartItem |
getParentCartItem()
Get the parent cart item that this cart item is dependent on. |
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 |
getType()
Get the type of this cart item. |
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. |
void |
setDependentCartItems(java.util.Set dependentCartItems)
Set the set of dependent cart items. |
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 element. |
| Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl |
|---|
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk |
| Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl |
|---|
getElasticPath, setElasticPath |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.elasticpath.domain.Persistence |
|---|
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk |
| Methods inherited from interface com.elasticpath.domain.EpDomain |
|---|
getElasticPath, setElasticPath |
| Field Detail |
|---|
public static final long serialVersionUID
| Constructor Detail |
|---|
public AbstractCartItemImpl()
| 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 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 java.util.Set getDependentCartItems()
getDependentCartItems in interface CartItempublic CartItem getParentCartItem()
getParentCartItem in interface CartItempublic ProductSku getProductSku()
getProductSku in interface CartItemProductSKUpublic int getQuantity()
getQuantity in interface CartItempublic java.lang.String getType()
getType in interface CartItempublic 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 void setDependentCartItems(java.util.Set dependentCartItems)
setDependentCartItems in interface CartItemdependentCartItems - the set of dependent cart items.public 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)
setType in interface CartItemtype - the type of cart item
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||