package gok.lesson.dao.bean;
/**
* 购物车
* @author setter
* 商品信息
* 数量
*/
public class BuyCarBean {
private McProductsBean mcProductsBean;//商品表信息
private int count;//数量
public BuyCarBean() {
// TODO Auto-generated constructor stub
}
/**
* 商品表信息
* @param mcProductsBean
* @param count
*/
public BuyCarBean(McProductsBean mcProductsBean, int count) {
super();
this.mcProductsBean = mcProductsBean;
this.count = count;
}
/**
* 商品表信息
* @return the mcProductsBean
*/
public McProductsBean getMcProductsBean() {
return mcProductsBean;
}
/**
* 商品表信息
* @param mcProductsBean the mcProductsBean to set
*
*/
public void setMcProductsBean(McProductsBean mcProductsBean) {
this.mcProductsBean = mcProductsBean;
}
/**
* 数量
* @return the count
*/
public int getCount() {
return count;
}
/**
* 数量
* @param count the count to set
*
*/
public void setCount(int count) {
this.count = count;
}
/**
* 判断购物车集合中是否存在重复的商品信息
*/
public boolean equals(Object obj) {
//super.equals(obj);
if (this == obj) {
return true;
}
if (obj instanceof BuyCarBean) {
BuyCarBean carBean = (BuyCarBean) obj;
// 商品编号相等则相等
return this.mcProductsBean.getNid().equals(carBean.mcProductsBean.getNid());
}
return false;
}
}