File tree Expand file tree Collapse file tree 4 files changed +10
-41
lines changed
main/java/com/pengrad/telegrambot/model
test/java/com/pengrad/telegrambot Expand file tree Collapse file tree 4 files changed +10
-41
lines changed Original file line number Diff line number Diff line change 11package com .pengrad .telegrambot .model ;
22
33import java .io .Serializable ;
4+ import java .util .Objects ;
45
56public class WriteAccessAllowed implements Serializable {
67 private final static long serialVersionUID = 0L ;
@@ -14,11 +15,18 @@ public String webAppName() {
1415 @ Override
1516 public boolean equals (Object o ) {
1617 if (this == o ) return true ;
17- return o != null && getClass () == o .getClass ();
18+ if (o == null || getClass () != o .getClass ()) return false ;
19+ WriteAccessAllowed that = (WriteAccessAllowed ) o ;
20+ return Objects .equals (web_app_name , that .web_app_name );
1821 }
1922
2023 @ Override
2124 public int hashCode () {
22- return 1 ;
25+ return Objects .hash (web_app_name );
26+ }
27+
28+ @ Override
29+ public String toString () {
30+ return "WriteAccessAllowed{" + "web_app_name='" + web_app_name + '\'' + '}' ;
2331 }
2432}
Original file line number Diff line number Diff line change @@ -35,20 +35,4 @@ public String startParameter() {
3535 return start_parameter ;
3636 }
3737
38- @ Override
39- public int hashCode () {
40- return Objects .hash (text ,
41- web_app ,
42- start_parameter );
43- }
44-
45- @ Override
46- public String toString () {
47- return "InlineQueryResultsButton{" +
48- "text='" + text + '\'' +
49- ", web_app=" + web_app +
50- ", start_parameter='" + start_parameter + '\'' +
51- '}' ;
52- }
53-
5438}
Original file line number Diff line number Diff line change @@ -36,26 +36,4 @@ public SwitchInlineQueryChosenChat allowChannelChats(Boolean allowChannelChats)
3636 this .allow_channel_chats = allowChannelChats ;
3737 return this ;
3838 }
39-
40- @ Override
41- public int hashCode () {
42- return Objects .hash (query ,
43- allow_user_chats ,
44- allow_bot_chats ,
45- allow_group_chats ,
46- allow_channel_chats
47- );
48- }
49-
50- @ Override
51- public String toString () {
52- return "SwitchInlineQueryChosenChat{" +
53- "query='" + query + '\'' +
54- ", allow_user_chats=" + allow_user_chats +
55- ", allow_bot_chats=" + allow_bot_chats +
56- ", allow_group_chats=" + allow_group_chats +
57- ", allow_channel_chats='" + allow_channel_chats + '\'' +
58- '}' ;
59- }
60-
6139}
Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ public void testEquals() throws ReflectiveOperationException {
8585 verifierApi .withIgnoredFields ("forum_topic_reopened" );
8686 verifierApi .withIgnoredFields ("general_forum_topic_hidden" );
8787 verifierApi .withIgnoredFields ("general_forum_topic_unhidden" );
88- verifierApi .withIgnoredFields ("write_access_allowed" );
8988 }
9089
9190 verifierApi .verify ();
You can’t perform that action at this time.
0 commit comments