public class Cart
extends java.lang.Object
Constructor and Description |
---|
Cart() |
Modifier and Type | Method and Description |
---|---|
void |
addItem(CartItem newItem) |
java.util.ArrayList<CartItem> |
getCartItems() |
int |
getItemsCount() |
java.math.BigDecimal |
getTotal()
Calculate the total price for all items in the cart.
|
boolean |
validate()
Validate cart items.
|
public void addItem(CartItem newItem)
public java.util.ArrayList<CartItem> getCartItems()
public java.math.BigDecimal getTotal()
public int getItemsCount()
public boolean validate() throws IPCException
IPCException
- if there are no items in the cart