You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookStore/src/com/yj/bean/User.java

95 lines
2.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.yj.bean;
/**
* @author yj
* @create 2020-08-21 10:41
*/
public class User {
// 用户ID使用Integer类型以便于处理数据库中的null值
private Integer id;
// 用户名
private String username;
// 密码
private String password;
// 邮箱地址
private String email;
// 用户地址
private String address;
// 获取用户地址
public String getAddress() {
return address;
}
// 设置用户地址
public void setAddress(String address) {
this.address = address;
}
// 获取用户ID
public Integer getId() {
return id;
}
// 设置用户ID
public void setId(Integer id) {
this.id = id;
}
// 获取用户名
public String getUsername() {
return username;
}
// 设置用户名
public void setUsername(String username) {
this.username = username;
}
// 获取密码
public String getPassword() {
return password;
}
// 设置密码
public void setPassword(String password) {
this.password = password;
}
// 获取邮箱
public String getEmail() {
return email;
}
// 设置邮箱
public void setEmail(String email) {
this.email = email;
}
// 重写toString方法方便输出用户信息
@Override
public String toString() {
return "User{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
", email='" + email + '\'' +
", address='" + address + '\'' +
'}';
}
// 无参构造函数
public User() {
}
// 带参数的构造函数,用于创建用户对象时初始化属性
public User(Integer id, String username, String password, String email, String address) {
this.id = id;
this.username = username;
this.password = password;
this.email = email;
this.address = address;
}
}