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) Contains item id.Gets the all cart items.Gets the cart item list.Gets the cart items.intGets the number of items.Gets the sub total.voidincrementQuantityByItemId(String itemId) Increment quantity by item id.removeItemById(String itemId) Removes the item by id.voidsetQuantityByItemId(String itemId, int quantity) Set quantity by item id.
-
Constructor Details
-
Cart
public Cart()
-
-
Method Details
-
getCartItems
-
getCartItemList
-
getNumberOfItems
public int getNumberOfItems()Gets the number of items.- Returns:
- the number of items
-
getAllCartItems
-
containsItemId
Contains item id.- Parameters:
itemId- the item id- Returns:
- true, if successful
-
addItem
Adds the item.- Parameters:
item- the itemisInStock- the is in stock
-
removeItemById
-
incrementQuantityByItemId
Increment quantity by item id.- Parameters:
itemId- the item id
-
setQuantityByItemId
Set quantity by item id.- Parameters:
itemId- the item idquantity- the quantity
-
getSubTotal
-