Skip to content

Commit fa96930

Browse files
committed
Added the field voter_chat to the class PollAnswer
1 parent 9695c57 commit fa96930

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/src/main/java/com/pengrad/telegrambot/model/PollAnswer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ public class PollAnswer implements Serializable {
1111
private final static long serialVersionUID = 0L;
1212

1313
private String poll_id;
14+
private Chat voter_chat;
1415
private User user;
1516
private Integer[] option_ids;
1617

1718
public String pollId() {
1819
return poll_id;
1920
}
2021

22+
public Chat voterChat() {
23+
return voter_chat;
24+
}
25+
2126
public User user() {
2227
return user;
2328
}
@@ -34,6 +39,7 @@ public boolean equals(Object o) {
3439
PollAnswer that = (PollAnswer) o;
3540

3641
if (poll_id != null ? !poll_id.equals(that.poll_id) : that.poll_id != null) return false;
42+
if (voter_chat != null ? !voter_chat.equals(that.voter_chat) : that.voter_chat != null) return false;
3743
if (user != null ? !user.equals(that.user) : that.user != null) return false;
3844
// Probably incorrect - comparing Object[] arrays with Arrays.equals
3945
return Arrays.equals(option_ids, that.option_ids);
@@ -42,6 +48,7 @@ public boolean equals(Object o) {
4248
@Override
4349
public int hashCode() {
4450
int result = poll_id != null ? poll_id.hashCode() : 0;
51+
result = 31 * result + (voter_chat != null ? voter_chat.hashCode() : 0);
4552
result = 31 * result + (user != null ? user.hashCode() : 0);
4653
result = 31 * result + Arrays.hashCode(option_ids);
4754
return result;
@@ -51,6 +58,7 @@ public int hashCode() {
5158
public String toString() {
5259
return "PollAnswer{" +
5360
"poll_id='" + poll_id + '\'' +
61+
", voter_chat=" + voter_chat +
5462
", user=" + user +
5563
", option_ids=" + Arrays.toString(option_ids) +
5664
'}';

0 commit comments

Comments
 (0)