package com.xu_six;
import java.io.Serializable;
/**
* 用户类
* @author XuSir
*2021年3月27日上午10:01:16
*/
public class User implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
// 用户的属性;必须私有化
private String userName; //用户名
private String userId; //用户身份ID
private String sex; //性别
private int age; //年龄
private String address; //居住地址
private String account; //银行账号
private String tel; //预留电话
private String passWord; //取款密码
private double banlance; //账户余额
// 提供外界获取属性的方法
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getPassWord() {
return passWord;
}
public void setPassWord(String passWord) {
this.passWord = passWord;
}
public double getBanlance() {
return banlance;
}
public void setBanlance(double banlance) {
this.banlance = banlance;
}
public User() {
// TODO Auto-generated constructor stub
}
public User(String userName, String userId, String sex,int age, String address,
String account, String tel,String passWord, double banlance) {
super();
this.userName = userName;
this.userId = userId;
this.sex = sex;
this.age = age;
this.address = address;
this.account = account;
this.tel = tel;
this.passWord = passWord;
this.banlance = banlance;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + ((userId == null) ? 0 : userId.hashCode());
result = prime * result + ((userName == null) ? 0 : userName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (userId == null) {
if (other.userId != null)
return false;
} else if (!userId.equals(other.userId))
return false;
if (userName == null) {
if (other.userName != null)
return false;
} else if (!userName.equals(other.userName))
return
06-02