📄 userinfo.java
字号:
package qq;
import java.io.Serializable;
public class UserInfo implements Serializable {
//变量声明
private int infoType;
//infoType取值:1-用户登陆,2-申请帐号,3-修改资料,4-退出登陆,5-获取好友列表
//infoType取值:6-服务器返回的请求添加为好友的好友信息
//infoType取值:7-服务器返回的请求删除的好友信息
private int userId;
private String passWord;
private String userName;
private String userIp;
private int userPort;
private boolean onLine;
//无参构造
public UserInfo() {
}
//有参构造
public UserInfo(int infoType, int userId, String passWord, String userName,
String userIp, int userPort, boolean onLine) {
this.infoType = infoType;
this.userId = userId;
this.passWord = passWord;
this.userName = userName;
this.userIp = userIp;
this.userPort = userPort;
this.onLine = onLine;
}
//设置属性
void setInfoType(int infoType) {
this.infoType = infoType;
}
void setUserId(int userId) {
this.userId = userId;
}
void setPassWord(String passWord) {
this.passWord = passWord;
}
void setUserName(String userName) {
this.userName = userName;
}
void setUserIp(String userIp) {
this.userIp = userIp;
}
void setUserPort(int userPort) {
this.userPort = userPort;
}
void setOnLine(boolean onLine) {
this.onLine = onLine;
}
//获得属性
int getInfoType() {
return this.infoType;
}
int getUserId() {
return this.userId;
}
String getPassWord() {
return this.passWord;
}
String getUserName() {
return this.userName;
}
String getUserIp() {
return this.userIp;
}
int getUserPort() {
return this.userPort;
}
boolean getOnLine() {
return this.onLine;
}
public int hashCode() {
return this.userId;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -