@@ -23,6 +23,8 @@ public enum Type {
2323 private Type type ;
2424 private Boolean allows_multiple_answers ;
2525 private Integer correct_option_id ;
26+ private String explanation ;
27+ private MessageEntity [] explanation_entities ;
2628
2729 public String id () {
2830 return id ;
@@ -60,6 +62,14 @@ public Integer correctOptionId() {
6062 return correct_option_id ;
6163 }
6264
65+ public String explanation () {
66+ return explanation ;
67+ }
68+
69+ public MessageEntity [] explanationEntities () {
70+ return explanation_entities ;
71+ }
72+
6373 @ Override
6474 public boolean equals (Object o ) {
6575 if (this == o ) return true ;
@@ -78,7 +88,11 @@ public boolean equals(Object o) {
7888 if (type != poll .type ) return false ;
7989 if (allows_multiple_answers != null ? !allows_multiple_answers .equals (poll .allows_multiple_answers ) : poll .allows_multiple_answers != null )
8090 return false ;
81- return correct_option_id != null ? correct_option_id .equals (poll .correct_option_id ) : poll .correct_option_id == null ;
91+ if (correct_option_id != null ? !correct_option_id .equals (poll .correct_option_id ) : poll .correct_option_id != null )
92+ return false ;
93+ if (explanation != null ? !explanation .equals (poll .explanation ) : poll .explanation != null ) return false ;
94+ // Probably incorrect - comparing Object[] arrays with Arrays.equals
95+ return Arrays .equals (explanation_entities , poll .explanation_entities );
8296 }
8397
8498 @ Override
@@ -98,6 +112,8 @@ public String toString() {
98112 ", type=" + type +
99113 ", allows_multiple_answers=" + allows_multiple_answers +
100114 ", correct_option_id=" + correct_option_id +
115+ ", explanation='" + explanation + '\'' +
116+ ", explanation_entities=" + Arrays .toString (explanation_entities ) +
101117 '}' ;
102118 }
103119}
0 commit comments