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 1
1
package com .pengrad .telegrambot .model ;
2
2
3
3
import java .io .Serializable ;
4
+ import java .util .Objects ;
4
5
5
6
public class WriteAccessAllowed implements Serializable {
6
7
private final static long serialVersionUID = 0L ;
@@ -14,11 +15,18 @@ public String webAppName() {
14
15
@ Override
15
16
public boolean equals (Object o ) {
16
17
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 );
18
21
}
19
22
20
23
@ Override
21
24
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 + '\'' + '}' ;
23
31
}
24
32
}
Original file line number Diff line number Diff line change @@ -35,20 +35,4 @@ public String startParameter() {
35
35
return start_parameter ;
36
36
}
37
37
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
-
54
38
}
Original file line number Diff line number Diff line change @@ -36,26 +36,4 @@ public SwitchInlineQueryChosenChat allowChannelChats(Boolean allowChannelChats)
36
36
this .allow_channel_chats = allowChannelChats ;
37
37
return this ;
38
38
}
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
-
61
39
}
Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ public void testEquals() throws ReflectiveOperationException {
85
85
verifierApi .withIgnoredFields ("forum_topic_reopened" );
86
86
verifierApi .withIgnoredFields ("general_forum_topic_hidden" );
87
87
verifierApi .withIgnoredFields ("general_forum_topic_unhidden" );
88
- verifierApi .withIgnoredFields ("write_access_allowed" );
89
88
}
90
89
91
90
verifierApi .verify ();
You can’t perform that action at this time.
0 commit comments