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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the item.booleancontainsItemId(String itemId) intGets the sub total.voidincrementQuantityByItemId(String itemId) Increment quantity by item id.removeItemById(String itemId) Removes the item by id.voidsetQuantityByItemId(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
-