SocialUserResponse.java
2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package com.yohomars.search.model;
import com.yoho.tools.common.beans.BaseBean;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
/**
* @author gris.wang
* @since 2018/2/23
**/
public class SocialUserResponse extends BaseBean {
private Integer rule;
private Integer page;
private Set<User> users;
public Integer getRule() {
return rule;
}
public void setRule(Integer rule) {
this.rule = rule;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Set<User> getUsers() {
return users;
}
public void setUsers(Set<User> users) {
this.users = users;
}
public void addUsers(Collection<User> users){
if(CollectionUtils.isEmpty(this.users)){
this.users = new HashSet<>();
}
this.users.addAll(users);
}
public static class User{
private Integer uid;
private String nickName;
private String headPic;
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getHeadPic() {
return headPic;
}
public void setHeadPic(String headPic) {
this.headPic = headPic;
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof User)){
return false;
}
if(obj == this){
return true;
}
User that = (User)obj;
return that.getUid().equals(this.getUid())
&& that.getNickName().equals(this.getNickName())
&& that.getHeadPic().equals(this.getHeadPic());
}
@Override
public int hashCode() {
int hash = 17;
hash = hash * 31 + getNickName().hashCode();
hash = hash * 31 + getHeadPic().hashCode();
hash = hash * 31 + getUid();
return hash;
}
}
}