Class Cart

java.lang.Object
org.mybatis.jpetstore.domain.Cart
All Implemented Interfaces:
Serializable

public class Cart extends Object implements Serializable
The Class Cart.
Author:
Eduardo Macarron
See Also:
  • Constructor Details

    • Cart

      public Cart()
  • Method Details

    • getCartItems

      public Iterator<CartItem> getCartItems()
    • getCartItemList

      public List<CartItem> getCartItemList()
    • getNumberOfItems

      public int getNumberOfItems()
    • getAllCartItems

      public Iterator<CartItem> getAllCartItems()
    • containsItemId

      public boolean containsItemId(String itemId)
    • addItem

      public void addItem(Item item, boolean isInStock)
      Adds the item.
      Parameters:
      item - the item
      isInStock - the is in stock
    • removeItemById

      public Item removeItemById(String itemId)
      Removes the item by id.
      Parameters:
      itemId - the item id
      Returns:
      the item
    • incrementQuantityByItemId

      public void incrementQuantityByItemId(String itemId)
      Increment quantity by item id.
      Parameters:
      itemId - the item id
    • setQuantityByItemId

      public void setQuantityByItemId(String itemId, int quantity)
    • getSubTotal

      public BigDecimal getSubTotal()
      Gets the sub total.
      Returns:
      the sub total