➊
public CartItem() {
// TODO Auto-generated constructor stub
}
➋
public CartItem(Book book) {
super();
this.book = book;
this.quantity = 1;
this.totalPrice = book.getUnitPrice();
}
➌
public Book getBook() {
return book;
}
public void setBook(Book book) {
this.book = book;
this.updateTotalPrice();
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
this.updateTotalPrice();
}
public int getTotalPrice() {
return totalPrice;
}