FileDocCategorySizeDatePackage
CartItem.javaAPI DocExample866Fri Dec 26 22:18:14 GMT 2003org.springframework.samples.jpetstore.domain

CartItem

public class CartItem extends Object implements Serializable

Fields Summary
private Item
item
private int
quantity
private boolean
inStock
Constructors Summary
Methods Summary
public ItemgetItem()

 return item; 
public intgetQuantity()

 return quantity; 
public doublegetTotalPrice()

		if (item != null) {
			return item.getListPrice() * quantity;
		}
		else {
			return 0;
		}
	
public voidincrementQuantity()

    quantity++;
  
public booleanisInStock()

 return inStock; 
public voidsetInStock(boolean inStock)

 this.inStock = inStock; 
public voidsetItem(Item item)

    this.item = item;
  
public voidsetQuantity(int quantity)

    this.quantity = quantity;