?? item.java
字號:
package com.tarena.shoppingcart.model;
import java.io.Serializable;
public class Item implements Serializable {
private Integer id;
private Product product;
private int number;
private double cost;
public Item(){
}
public double getCost() {
return cost;
}
public void setCost(double cost) {
this.cost = cost;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
@Override
public boolean equals(Object o) {
if(o==null) return false;
if(o==this) return true;
if(!(o instanceof Item)) return false;
Item i = (Item)o;
if(i.id!=null || this.id!=null) return this.id.equals(i.id);
if(i.product!=null || this.product!=null) return this.product.getId().equals(i.product.getId());
return true;
}
@Override
public int hashCode() {
return id==null ? 0 :id.hashCode();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -