Skip to content

Commit 12697dc

Browse files
committed
Add fields to ChatShared: title, username, photo
1 parent 38cdd35 commit 12697dc

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed
Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package com.pengrad.telegrambot.model;
22

33
import java.io.Serializable;
4+
import java.util.Arrays;
45
import java.util.Objects;
56

67
public class ChatShared implements Serializable {
78
private final static long serialVersionUID = 0L;
89

910
private Integer request_id;
1011
private Long chat_id;
12+
private String title;
13+
private String username;
14+
private PhotoSize[] photo;
1115

1216
public Integer requestId() {
1317
return request_id;
@@ -17,28 +21,49 @@ public Long chatId() {
1721
return chat_id;
1822
}
1923

24+
public String title() {
25+
return title;
26+
}
27+
28+
public String username() {
29+
return username;
30+
}
31+
32+
public PhotoSize[] photo() {
33+
return photo;
34+
}
35+
2036
@Override
2137
public boolean equals(Object o) {
2238
if (this == o) return true;
2339
if (o == null || getClass() != o.getClass()) return false;
2440

2541
ChatShared that = (ChatShared) o;
2642

27-
return Objects.equals(request_id, that.request_id) &&
28-
Objects.equals(chat_id, that.chat_id);
43+
return Objects.equals(request_id, that.request_id)
44+
&& Objects.equals(chat_id, that.chat_id)
45+
&& Objects.equals(title, that.title)
46+
&& Objects.equals(username, that.username)
47+
&& Arrays.equals(photo, that.photo);
2948
}
3049

3150
@Override
3251
public int hashCode() {
3352
return Objects.hash(request_id,
34-
chat_id);
53+
chat_id,
54+
title,
55+
username,
56+
Arrays.hashCode(photo));
3557
}
3658

3759
@Override
3860
public String toString() {
3961
return "ChatShared{" +
40-
"request_id='" + request_id + '\'' +
41-
", chat_id='" + chat_id + '\'' +
42-
'}';
62+
"request_id=" + request_id +
63+
", chat_id=" + chat_id +
64+
", title='" + title + '\'' +
65+
", username='" + username + '\'' +
66+
", photo=" + Arrays.toString(photo) +
67+
'}';
4368
}
4469
}

0 commit comments

Comments
 (0)