1 27 package olstore.dto; 28 import java.io.Serializable; 29 import java.math.BigDecimal; 30 31 import olstore.entity.ItemLocal; 32 33 public class ShoppingCartItem implements Serializable{ 34 private Integer itemId; 35 private String name; 36 private BigDecimal price; 37 private BigDecimal unitPrice; 38 private String quantity; 44 45 public ShoppingCartItem(){ 46 itemId = null; 47 name = null; 48 price = null; 49 quantity = null; 50 } 51 52 public ShoppingCartItem(ItemLocal item){ 53 itemId = item.getItemId(); 54 name = item.getName(); 55 unitPrice = item.getPrice(); 56 price = new BigDecimal(0); 57 } 58 59 public String toString(){ 60 return ("itemId="+ itemId + "\tname=" + name + "\tprice=" + price + "\tunitPrice=" + unitPrice + "\tquantity=" + quantity); 61 62 } 63 64 public Integer getItemId(){ 65 return itemId; 66 } 67 68 public String getName () { 69 return name ; 70 } 71 72 public void setName ( String name) { 73 this.name = name; 74 } 75 76 public BigDecimal getPrice () { 77 return price; 78 } 79 80 public void setPrice ( BigDecimal price ) { 81 this.price = price; 82 } 83 84 public String getQuantity () { 85 return quantity; 86 } 87 88 public void setQuantity ( String quantity) { 89 this.quantity = quantity; 90 } 91 92 93 } 94 | Popular Tags |