11package com .pengrad .telegrambot .model ;
22
33import java .io .Serializable ;
4+ import java .util .Arrays ;
45
56/**
67 * Stas Parshin
@@ -14,6 +15,8 @@ public class WebhookInfo implements Serializable {
1415 private Integer pending_update_count ;
1516 private Integer last_error_date ;
1617 private String last_error_message ;
18+ private Integer max_connections ;
19+ private String [] allowed_updates ;
1720
1821 public String url () {
1922 return url ;
@@ -35,6 +38,14 @@ public String lastErrorMessage() {
3538 return last_error_message ;
3639 }
3740
41+ public Integer maxConnections () {
42+ return max_connections ;
43+ }
44+
45+ public String [] allowedUpdates () {
46+ return allowed_updates ;
47+ }
48+
3849 @ Override
3950 public boolean equals (Object o ) {
4051 if (this == o ) return true ;
@@ -49,7 +60,12 @@ public boolean equals(Object o) {
4960 return false ;
5061 if (last_error_date != null ? !last_error_date .equals (that .last_error_date ) : that .last_error_date != null )
5162 return false ;
52- return last_error_message != null ? last_error_message .equals (that .last_error_message ) : that .last_error_message == null ;
63+ if (last_error_message != null ? !last_error_message .equals (that .last_error_message ) : that .last_error_message != null )
64+ return false ;
65+ if (max_connections != null ? !max_connections .equals (that .max_connections ) : that .max_connections != null )
66+ return false ;
67+ // Probably incorrect - comparing Object[] arrays with Arrays.equals
68+ return Arrays .equals (allowed_updates , that .allowed_updates );
5369 }
5470
5571 @ Override
@@ -59,6 +75,8 @@ public int hashCode() {
5975 result = 31 * result + (pending_update_count != null ? pending_update_count .hashCode () : 0 );
6076 result = 31 * result + (last_error_date != null ? last_error_date .hashCode () : 0 );
6177 result = 31 * result + (last_error_message != null ? last_error_message .hashCode () : 0 );
78+ result = 31 * result + (max_connections != null ? max_connections .hashCode () : 0 );
79+ result = 31 * result + Arrays .hashCode (allowed_updates );
6280 return result ;
6381 }
6482
@@ -70,6 +88,8 @@ public String toString() {
7088 ", pending_update_count=" + pending_update_count +
7189 ", last_error_date=" + last_error_date +
7290 ", last_error_message='" + last_error_message + '\'' +
91+ ", max_connections=" + max_connections +
92+ ", allowed_updates=" + Arrays .toString (allowed_updates ) +
7393 '}' ;
7494 }
7595}
0 commit comments