|
8 | 8 | */ |
9 | 9 | public class Message { |
10 | 10 |
|
11 | | - private final Integer message_id; |
12 | | - private final User from; |
13 | | - private final Integer date; |
14 | | - private final Chat chat; |
15 | | - private final User forward_from; |
16 | | - private final Integer forward_date; |
17 | | - private final Message reply_to_message; |
18 | | - private final String text; |
19 | | - private final Audio audio; |
20 | | - private final Document document; |
21 | | - private final PhotoSize[] photo; |
22 | | - private final Sticker sticker; |
23 | | - private final Video video; |
24 | | - private final Voice voice; |
25 | | - private final String caption; |
26 | | - private final Contact contact; |
27 | | - private final Location location; |
28 | | - private final User new_chat_participant; |
29 | | - private final User left_chat_participant; |
30 | | - private final String new_chat_title; |
31 | | - private final PhotoSize[] new_chat_photo; |
32 | | - private final Boolean delete_chat_photo; |
33 | | - private final Boolean group_chat_created; |
34 | | - private final Boolean supergroup_chat_created; |
35 | | - private final Boolean channel_chat_created; |
36 | | - private final Long migrate_to_chat_id; |
37 | | - private final Long migrate_from_chat_id; |
38 | | - |
39 | | - public Message(Integer message_id, User from, Integer date, Chat chat, User forward_from, Integer forward_date, Message reply_to_message, String text, Audio audio, Document document, PhotoSize[] photo, Sticker sticker, Video video, Voice voice, String caption, Contact contact, Location location, User new_chat_participant, User left_chat_participant, String new_chat_title, PhotoSize[] new_chat_photo, Boolean delete_chat_photo, Boolean group_chat_created, Boolean supergroup_chat_created, Boolean channel_chat_created, Long migrate_to_chat_id, Long migrate_from_chat_id) { |
40 | | - this.message_id = message_id; |
41 | | - this.from = from; |
42 | | - this.date = date; |
43 | | - this.chat = chat; |
44 | | - this.forward_from = forward_from; |
45 | | - this.forward_date = forward_date; |
46 | | - this.reply_to_message = reply_to_message; |
47 | | - this.text = text; |
48 | | - this.audio = audio; |
49 | | - this.document = document; |
50 | | - this.photo = photo; |
51 | | - this.sticker = sticker; |
52 | | - this.video = video; |
53 | | - this.voice = voice; |
54 | | - this.caption = caption; |
55 | | - this.contact = contact; |
56 | | - this.location = location; |
57 | | - this.new_chat_participant = new_chat_participant; |
58 | | - this.left_chat_participant = left_chat_participant; |
59 | | - this.new_chat_title = new_chat_title; |
60 | | - this.new_chat_photo = new_chat_photo; |
61 | | - this.delete_chat_photo = delete_chat_photo; |
62 | | - this.group_chat_created = group_chat_created; |
63 | | - this.supergroup_chat_created = supergroup_chat_created; |
64 | | - this.channel_chat_created = channel_chat_created; |
65 | | - this.migrate_to_chat_id = migrate_to_chat_id; |
66 | | - this.migrate_from_chat_id = migrate_from_chat_id; |
| 11 | + private Integer message_id; |
| 12 | + private User from; |
| 13 | + private Integer date; |
| 14 | + private Chat chat; |
| 15 | + private User forward_from; |
| 16 | + private Integer forward_date; |
| 17 | + private Message reply_to_message; |
| 18 | + private String text; |
| 19 | + private Audio audio; |
| 20 | + private Document document; |
| 21 | + private PhotoSize[] photo; |
| 22 | + private Sticker sticker; |
| 23 | + private Video video; |
| 24 | + private Voice voice; |
| 25 | + private String caption; |
| 26 | + private Contact contact; |
| 27 | + private Location location; |
| 28 | + private User new_chat_participant; |
| 29 | + private User left_chat_participant; |
| 30 | + private String new_chat_title; |
| 31 | + private PhotoSize[] new_chat_photo; |
| 32 | + private Boolean delete_chat_photo; |
| 33 | + private Boolean group_chat_created; |
| 34 | + private Boolean supergroup_chat_created; |
| 35 | + private Boolean channel_chat_created; |
| 36 | + private Long migrate_to_chat_id; |
| 37 | + private Long migrate_from_chat_id; |
| 38 | + |
| 39 | + Message() { |
67 | 40 | } |
68 | 41 |
|
69 | 42 | public Integer messageId() { |
@@ -181,10 +154,10 @@ public boolean equals(Object o) { |
181 | 154 |
|
182 | 155 | Message message = (Message) o; |
183 | 156 |
|
184 | | - if (!message_id.equals(message.message_id)) return false; |
| 157 | + if (message_id != null ? !message_id.equals(message.message_id) : message.message_id != null) return false; |
185 | 158 | if (from != null ? !from.equals(message.from) : message.from != null) return false; |
186 | | - if (!date.equals(message.date)) return false; |
187 | | - if (!chat.equals(message.chat)) return false; |
| 159 | + if (date != null ? !date.equals(message.date) : message.date != null) return false; |
| 160 | + if (chat != null ? !chat.equals(message.chat) : message.chat != null) return false; |
188 | 161 | if (forward_from != null ? !forward_from.equals(message.forward_from) : message.forward_from != null) |
189 | 162 | return false; |
190 | 163 | if (forward_date != null ? !forward_date.equals(message.forward_date) : message.forward_date != null) |
@@ -221,7 +194,6 @@ public boolean equals(Object o) { |
221 | 194 | if (migrate_to_chat_id != null ? !migrate_to_chat_id.equals(message.migrate_to_chat_id) : message.migrate_to_chat_id != null) |
222 | 195 | return false; |
223 | 196 | return migrate_from_chat_id != null ? migrate_from_chat_id.equals(message.migrate_from_chat_id) : message.migrate_from_chat_id == null; |
224 | | - |
225 | 197 | } |
226 | 198 |
|
227 | 199 | @Override |
|
0 commit comments