-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroupInfoBean.java
181 lines (148 loc) · 4.54 KB
/
GroupInfoBean.java
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
package com.xmen.xteam.communication.bean;
import android.text.TextUtils;
import com.xmen.xteam.msgsockey.socket.adapter.ReceiveProtocol;
import com.xmen.xteam.utils.HanziToPinyin;
import java.util.HashMap;
/**
* 创 建 者: lwh
* 创建时间: 2018/1/2
* 描 述:
*/
public class GroupInfoBean extends BaseSocketBean {
private int gid; //群组id
private String gname; //群组名称
private String avatar; //群组头像url
private int role; //用户角色0-普通用户 1-管理员 2-创建者 3-机器人
private int gtp; //0-公告版1-普通群
private int stat; //是否删除,0-正常,1-删除
private int ctm; //创建时间
private String whole;//全拼
public String simple;//简拼
public String initial;//简拼
public GroupInfoBean(HashMap<String, Object> receiveProtocol, ReceiveProtocol preseq) {
super(receiveProtocol, preseq);
}
public GroupInfoBean(int gid, String gname, String avatar, int role, int gtp, int stat, int ctm, String whole, String simple, String initial) {
this.gid = gid;
this.gname = gname;
this.avatar = avatar;
this.role = role;
this.gtp = gtp;
this.stat = stat;
this.ctm = ctm;
this.whole = whole;
this.simple = simple;
this.initial = initial;
}
public GroupInfoBean(int gid, String gname, String avatar) {
this.gid = gid;
this.gname = gname;
this.avatar = avatar;
if (TextUtils.isEmpty(gname)) {
return;
}
HanziToPinyin.Pinyin pinyin = HanziToPinyin.getInstance().getPinyin(gname);
whole = pinyin.whole;
simple = pinyin.simple;
initial = pinyin.initial;
}
public GroupInfoBean(int gid, String gname, String avatar, int role, int gtp, int stat, int ctm) {
this.gid = gid;
this.gname = gname;
this.avatar = avatar;
this.role = role;
this.gtp = gtp;
this.stat = stat;
this.ctm = ctm;
HanziToPinyin.Pinyin pinyin = HanziToPinyin.getInstance().getPinyin(gname);
whole = pinyin.whole;
simple = pinyin.simple;
initial = pinyin.initial;
}
@Override
protected void parse(HashMap<String, Object> receiveProtocol, ReceiveProtocol preseq) {
gid = getInt("gid");
gname = getString("gnm");
avatar = getString("avt");
role = getInt("role");
gtp = getInt("gtp");
stat = getInt("stat");
ctm = getInt("ctm");
HanziToPinyin.Pinyin pinyin = HanziToPinyin.getInstance().getPinyin(gname);
whole = pinyin.whole;
simple = pinyin.simple;
initial = pinyin.initial;
}
public String getWhole() {
return whole;
}
public String getSimple() {
return simple;
}
public int getGid() {
return gid;
}
public String getGname() {
return gname;
}
public String getAvatar() {
return avatar;
}
public int getRole() {
return role;
}
public int getGtp() {
return gtp;
}
public int getStat() {
return stat;
}
public int getCtm() {
return ctm;
}
public void setGid(int gid) {
this.gid = gid;
}
public void setGname(String gname) {
this.gname = gname;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public void setRole(int role) {
this.role = role;
}
public void setGtp(int gtp) {
this.gtp = gtp;
}
public void setStat(int stat) {
this.stat = stat;
}
public void setCtm(int ctm) {
this.ctm = ctm;
}
public void setWhole(String whole) {
this.whole = whole;
}
public void setSimple(String simple) {
this.simple = simple;
}
public String getInitial() {
return initial;
}
@Override
public String toString() {
return "GroupInfoBean{" +
"gid=" + gid +
", gname='" + gname + '\'' +
", avatar='" + avatar + '\'' +
", role=" + role +
", gtp=" + gtp +
", stat=" + stat +
", ctm=" + ctm +
", whole='" + whole + '\'' +
", simple='" + simple + '\'' +
", initial='" + initial + '\'' +
'}';
}
}