Package org.mybatis.jpetstore.domain
Class Cart
java.lang.Object
org.mybatis.jpetstore.domain.Cart
- All Implemented Interfaces:
Serializable
The Class Cart.
- Author:
- Eduardo Macarron
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the item.boolean
containsItemId
(String itemId) int
Gets the sub total.void
incrementQuantityByItemId
(String itemId) Increment quantity by item id.removeItemById
(String itemId) Removes the item by id.void
setQuantityByItemId
(String itemId, int quantity)
-
Constructor Details
-
Cart
public Cart()
-
-
Method Details
-
getCartItems
-
getCartItemList
-
getNumberOfItems
public int getNumberOfItems() -
getAllCartItems
-
containsItemId
-
addItem
Adds the item.- Parameters:
item
- the itemisInStock
- the is in stock
-
removeItemById
Removes the item by id.- Parameters:
itemId
- the item id- Returns:
- the item
-
incrementQuantityByItemId
Increment quantity by item id.- Parameters:
itemId
- the item id
-
setQuantityByItemId
-
getSubTotal
Gets the sub total.- Returns:
- the sub total
-