类名Items

package entity;

//商品类
public class Items { private int id; // 商品编号
private String name; // 商品名称
private String city; // 产地
private int price; // 价格
private int number; // 库存
private String picture; // 商品图片 //保留此不带参数的构造方法
public Items()
{ } public Items(int id,String name,String city,int price,int number,String picture)
{
this.id = id;
this.name = name;
this.city = city;
this.picture = picture;
this.price = price;
this.number = number; }
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} public String getName() {
return name;
} public void setName(String name) {
this.name = name;
} public String getCity() {
return city;
} public void setCity(String city) {
this.city = city;
} public int getPrice() {
return price;
} public void setPrice(int price) {
this.price = price;
} public int getNumber() {
return number;
} public void setNumber(int number) {
this.number = number;
} public String getPicture() {
return picture;
} public void setPicture(String picture) {
this.picture = picture;
} @Override
public int hashCode() {
// TODO Auto-generated method stub
return this.getId()+this.getName().hashCode();
} @Override
public boolean equals(Object obj) {
// TODO Auto-generated method stub
if(this==obj)
{
return true;
}
if(obj instanceof Items)
{
Items i = (Items)obj;
if(this.getId()==i.getId()&&this.getName().equals(i.getName()))
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
} public String toString()
{
return "商品编号:"+this.getId()+",商品名称:"+this.getName();
} }

最新文章

  1. Spring MVC 处理静态资源文件
  2. GitHub 上 57 款最流行的开源深度学习项目
  3. javascript 函数重载 overloading
  4. django模板里循环变量<table>里想要两个一行如何控制
  5. 【原创】NIO框架入门(二):服务端基于MINA2的UDP双向通信Demo演示
  6. <textarea>输入框提示文字
  7. 树莓派(Raspberry Pi)修改时区
  8. [Angular2 Form] Use RxJS Streams with Angular 2 Forms
  9. ios状态栏调整 简单动画的知识点
  10. MFC的消息机制
  11. [Cocos2d-x]节点的尺寸大小
  12. .Net Core 第三方工具包整理
  13. Python自学笔记-递归函数(来自廖雪峰的官网Python3)
  14. DataBase MongoDB高级知识-易使用
  15. 3-51单片机WIFI学习(开发板8266底层源码介绍)
  16. odoo开发笔记 -- 模型字段定义中设置默认值
  17. linux umask使用方法
  18. redis-set
  19. 增加wamp64 PHP支持版本
  20. Linux tar 解压 压缩(转)

热门文章

  1. BZOJ 1006: [HNOI2008]神奇的国度(弦图)
  2. 微信公众号ios10.1 版本白屏问题
  3. 用JOptionPane类实现各种对话框
  4. LINUXE下执行php 定时任务
  5. jackson反序列化报错Unrecognized field , not marked as ignorable
  6. Java短路运算符和非短路运算符
  7. intellij免费激活码
  8. 【lua学习笔记】——Notepad++ 设置运行 lua 和 python
  9. STL中六大组件
  10. Eureka 系列(03)Spring Cloud 自动装配原理