forked from pengrad/java-telegram-bot-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatFullInfo.java
More file actions
408 lines (344 loc) · 14.4 KB
/
ChatFullInfo.java
File metadata and controls
408 lines (344 loc) · 14.4 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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
package com.pengrad.telegrambot.model;
import com.google.gson.annotations.SerializedName;
import com.pengrad.telegrambot.model.business.BusinessIntro;
import com.pengrad.telegrambot.model.business.BusinessLocation;
import com.pengrad.telegrambot.model.business.BusinessOpeningHours;
import com.pengrad.telegrambot.model.gift.AcceptedGiftTypes;
import com.pengrad.telegrambot.model.gift.unique.UniqueGiftColors;
import com.pengrad.telegrambot.model.reaction.ReactionType;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;
public class ChatFullInfo implements Serializable {
private final static long serialVersionUID = 0L;
public enum Type {
@SerializedName("private") Private, group, supergroup, channel
}
private Long id;
private Type type;
//Channel and Group
private String title;
//Private and Channel
private String username;
//Private
private String first_name;
private String last_name;
private Boolean is_forum;
private Boolean is_direct_messages;
private ChatPhoto photo;
private String[] active_usernames;
private Birthdate birthdate;
private BusinessIntro business_intro;
private BusinessLocation business_location;
private BusinessOpeningHours business_opening_hours;
private Chat personal_chat;
private Chat parent_chat;
private ReactionType[] available_reactions;
private Integer accent_color_id;
private Integer max_reaction_count;
private String background_custom_emoji_id;
private Integer profile_accent_color_id;
private String profile_background_custom_emoji_id;
private String emoji_status_custom_emoji_id;
private Integer emoji_status_expiration_date;
private String bio;
private Boolean has_private_forwards;
private Boolean has_restricted_voice_and_video_messages;
private Boolean has_hidden_members;
private Boolean has_aggressive_anti_spam_enabled;
private Boolean join_to_send_messages;
private Boolean join_by_request;
private String description;
private String invite_link;
private Message pinned_message;
private ChatPermissions permissions;
private Boolean can_send_paid_media;
private Integer slow_mode_delay;
private Integer unrestrict_boost_count;
private Integer message_auto_delete_time;
private Boolean has_protected_content;
private Boolean has_visible_history;
private String sticker_set_name;
private Boolean can_set_sticker_set;
private String custom_emoji_sticker_set_name;
private Long linked_chat_id;
private ChatLocation location;
private Boolean can_send_gift;
private AcceptedGiftTypes accepted_gift_types;
private UserRating rating;
private Integer paid_message_star_count;
private UniqueGiftColors unique_gift_colors;
public Long id() {
return id;
}
public Type type() {
return type;
}
public String firstName() {
return first_name;
}
public String lastName() {
return last_name;
}
public String username() {
return username;
}
public Boolean isForum() {
return is_forum != null && is_forum;
}
public Boolean isDirectMessages() {
return is_direct_messages != null && is_direct_messages;
}
public String title() {
return title;
}
public ChatPhoto photo() {
return photo;
}
public String[] activeUsernames() {
return active_usernames;
}
public Birthdate birthdate() {
return birthdate;
}
public BusinessIntro businessIntro() {
return business_intro;
}
public BusinessLocation businessLocation() {
return business_location;
}
public BusinessOpeningHours businessOpeningHours() {
return business_opening_hours;
}
public Chat personalChat() {
return personal_chat;
}
public Chat parentChat() {
return parent_chat;
}
public ReactionType[] availableReactions() {
return available_reactions;
}
public Integer accentColorId() {
return accent_color_id;
}
public Integer maxReactionCount() {
return max_reaction_count;
}
public String backgroundCustomEmojiId() {
return background_custom_emoji_id;
}
public Integer profileAccentColorId() {
return profile_accent_color_id;
}
public String profileBackgroundCustomEmojiId() {
return profile_background_custom_emoji_id;
}
public String emojiStatusCustomEmojiId() {
return emoji_status_custom_emoji_id;
}
public Integer emojiStatusExpirationDate() {
return emoji_status_expiration_date;
}
public String bio() {
return bio;
}
public Boolean hasPrivateForwards() {
return has_private_forwards != null && has_private_forwards;
}
public Boolean hasRestrictedVoiceAndVideoMessages() {
return has_restricted_voice_and_video_messages != null && has_restricted_voice_and_video_messages;
}
public Boolean hasHiddenMembers() {
return has_hidden_members != null && has_hidden_members;
}
public Boolean hasAggressiveAntiSpamEnabled() {
return has_aggressive_anti_spam_enabled != null && has_aggressive_anti_spam_enabled;
}
public Boolean joinToSendMessages() {
return join_to_send_messages != null && join_to_send_messages;
}
public Boolean joinByRequest() {
return join_by_request != null && join_by_request;
}
public String description() {
return description;
}
public String inviteLink() {
return invite_link;
}
public Message pinnedMessage() {
return pinned_message;
}
public ChatPermissions permissions() {
return permissions;
}
public Boolean canSendPaidMedia() {
return can_send_paid_media;
}
public Integer slowModeDelay() {
return slow_mode_delay;
}
public Integer unrestrictBoostCount() {
return unrestrict_boost_count;
}
public Integer messageAutoDeleteTime() {
return message_auto_delete_time;
}
public Boolean hasProtectedContent() {
return has_protected_content != null && has_protected_content;
}
public Boolean hasVisibleHistory() {
return has_visible_history != null && has_visible_history;
}
public String stickerSetName() {
return sticker_set_name;
}
public Boolean canSetStickerSet() {
return can_set_sticker_set != null && can_set_sticker_set;
}
public String customEmojiStickerSetName() {
return custom_emoji_sticker_set_name;
}
public Long linkedChatId() {
return linked_chat_id;
}
public ChatLocation location() {
return location;
}
/**
*
* @deprecated Use 'acceptedGiftTypes' instead
*/
@Deprecated
public Boolean canSendGift() {
return can_send_gift;
}
public AcceptedGiftTypes acceptedGiftTypes() {
return accepted_gift_types;
}
public UserRating rating() {
return rating;
}
public Integer paidMessageStarCount() {
return paid_message_star_count;
}
public UniqueGiftColors uniqueGiftColors() {
return unique_gift_colors;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ChatFullInfo chat = (ChatFullInfo) o;
return Objects.equals(id, chat.id) &&
type == chat.type &&
Objects.equals(first_name, chat.first_name) &&
Objects.equals(last_name, chat.last_name) &&
Objects.equals(is_forum, chat.is_forum) &&
Objects.equals(is_direct_messages, chat.is_direct_messages) &&
Objects.equals(username, chat.username) &&
Objects.equals(title, chat.title) &&
Objects.equals(photo, chat.photo) &&
Arrays.equals(active_usernames, chat.active_usernames) &&
Objects.equals(birthdate, chat.birthdate) &&
Objects.equals(business_intro, chat.business_intro) &&
Objects.equals(business_location, chat.business_location) &&
Objects.equals(business_opening_hours, chat.business_opening_hours) &&
Objects.equals(personal_chat, chat.personal_chat) &&
Objects.equals(parent_chat, chat.parent_chat) &&
Arrays.equals(available_reactions, chat.available_reactions) &&
Objects.equals(accent_color_id, chat.accent_color_id) &&
Objects.equals(max_reaction_count, chat.max_reaction_count) &&
Objects.equals(background_custom_emoji_id, chat.background_custom_emoji_id) &&
Objects.equals(profile_accent_color_id, chat.profile_accent_color_id) &&
Objects.equals(profile_background_custom_emoji_id, chat.profile_background_custom_emoji_id) &&
Objects.equals(emoji_status_custom_emoji_id, chat.emoji_status_custom_emoji_id) &&
Objects.equals(emoji_status_expiration_date, chat.emoji_status_expiration_date) &&
Objects.equals(bio, chat.bio) &&
Objects.equals(has_private_forwards, chat.has_private_forwards) &&
Objects.equals(has_restricted_voice_and_video_messages, chat.has_restricted_voice_and_video_messages) &&
Objects.equals(has_hidden_members, chat.has_hidden_members) &&
Objects.equals(has_aggressive_anti_spam_enabled, chat.has_aggressive_anti_spam_enabled) &&
Objects.equals(join_to_send_messages, chat.join_to_send_messages) &&
Objects.equals(join_by_request, chat.join_by_request) &&
Objects.equals(description, chat.description) &&
Objects.equals(invite_link, chat.invite_link) &&
Objects.equals(pinned_message, chat.pinned_message) &&
Objects.equals(permissions, chat.permissions) &&
Objects.equals(can_send_paid_media, chat.can_send_paid_media) &&
Objects.equals(slow_mode_delay, chat.slow_mode_delay) &&
Objects.equals(unrestrict_boost_count, chat.unrestrict_boost_count) &&
Objects.equals(message_auto_delete_time, chat.message_auto_delete_time) &&
Objects.equals(has_protected_content, chat.has_protected_content) &&
Objects.equals(has_visible_history, chat.has_visible_history) &&
Objects.equals(sticker_set_name, chat.sticker_set_name) &&
Objects.equals(can_set_sticker_set, chat.can_set_sticker_set) &&
Objects.equals(custom_emoji_sticker_set_name, chat.custom_emoji_sticker_set_name) &&
Objects.equals(linked_chat_id, chat.linked_chat_id) &&
Objects.equals(location, chat.location) &&
Objects.equals(accepted_gift_types, chat.accepted_gift_types) &&
Objects.equals(rating, chat.rating) &&
Objects.equals(paid_message_star_count, chat.paid_message_star_count) &&
Objects.equals(unique_gift_colors, chat.unique_gift_colors);
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}
@Override
public String toString() {
return "ChatFullInfo{" +
"id=" + id +
", type=" + type +
", first_name='" + first_name + '\'' +
", last_name='" + last_name + '\'' +
", is_forum=" + is_forum +
", is_direct_messages=" + is_direct_messages +
", username='" + username + '\'' +
", title='" + title + '\'' +
", photo=" + photo +
", active_usernames=" + Arrays.toString(active_usernames) +
", birthdate=" + birthdate +
", business_intro=" + business_intro +
", business_location=" + business_location +
", business_opening_hours=" + business_opening_hours +
", personal_chat=" + personal_chat +
", parent_chat=" + parent_chat +
", available_reactions=" + Arrays.toString(available_reactions) +
", accent_color_id=" + accent_color_id +
", max_reaction_count=" + max_reaction_count +
", background_custom_emoji_id='" + background_custom_emoji_id + '\'' +
", profile_accent_color_id=" + profile_accent_color_id +
", profile_background_custom_emoji_id='" + profile_background_custom_emoji_id + '\'' +
", emoji_status_custom_emoji_id='" + emoji_status_custom_emoji_id + '\'' +
", emoji_status_expiration_date='" + emoji_status_expiration_date + '\'' +
", bio='" + bio + '\'' +
", has_private_forwards=" + has_private_forwards +
", has_restricted_voice_and_video_messages=" + has_restricted_voice_and_video_messages +
", has_hidden_members=" + has_hidden_members +
", has_aggressive_anti_spam_enabled=" + has_aggressive_anti_spam_enabled +
", join_to_send_messages=" + join_to_send_messages +
", join_by_request=" + join_by_request +
", description='" + description + '\'' +
", invite_link='" + invite_link + '\'' +
", pinned_message=" + pinned_message +
", permissions=" + permissions +
", can_send_paid_media=" + can_send_paid_media +
", slow_mode_delay=" + slow_mode_delay +
", unrestrict_boost_count=" + unrestrict_boost_count +
", message_auto_delete_time=" + message_auto_delete_time +
", has_protected_content=" + has_protected_content +
", has_visible_history=" + has_visible_history +
", sticker_set_name='" + sticker_set_name + '\'' +
", can_set_sticker_set=" + can_set_sticker_set +
", custom_emoji_sticker_set_name=" + custom_emoji_sticker_set_name +
", linked_chat_id=" + linked_chat_id +
", location=" + location +
", accepted_gift_types=" + accepted_gift_types +
", rating=" + rating +
", paid_message_star_count=" + paid_message_star_count +
", unique_gift_colors=" + unique_gift_colors +
'}';
}
}