|
2 | 2 |
|
3 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
4 | 4 | import com.fasterxml.jackson.annotation.JsonInclude;
|
5 |
| - |
6 |
| -import java.io.Serializable; |
| 5 | +import org.bot4j.base.request.BaseConnections; |
7 | 6 |
|
8 | 7 | @JsonIgnoreProperties(ignoreUnknown = true)
|
9 | 8 | @JsonInclude(JsonInclude.Include.NON_NULL)
|
10 |
| -public class TelegramConnections implements Serializable { |
| 9 | +public class TelegramConnections extends BaseConnections { |
11 | 10 | public TelegramConnections() {
|
12 | 11 | super();
|
13 | 12 | }
|
14 | 13 |
|
15 |
| - private boolean debugging = false; // enable to trace log as debug mode |
16 |
| - private boolean skip = false; // skipping the action for sending message |
17 |
| - private boolean retry = false; // enable retry REST HTTP Telegram API when sending message got failure |
18 |
| - private int maxRetries = 2; // retry no. times when sending message, default is 2 times |
19 |
| - |
20 |
| - public boolean isDebugging() { |
21 |
| - return debugging; |
22 |
| - } |
23 |
| - |
24 |
| - public void setDebugging(boolean debugging) { |
25 |
| - this.debugging = debugging; |
26 |
| - } |
27 |
| - |
28 |
| - public boolean isSkip() { |
29 |
| - return skip; |
30 |
| - } |
31 |
| - |
32 |
| - public void setSkip(boolean skip) { |
33 |
| - this.skip = skip; |
34 |
| - } |
35 |
| - |
36 |
| - public boolean isRetry() { |
37 |
| - return retry; |
38 |
| - } |
39 |
| - |
40 |
| - public void setRetry(boolean retry) { |
41 |
| - this.retry = retry; |
42 |
| - } |
43 |
| - |
44 |
| - public int getMaxRetries() { |
45 |
| - return maxRetries; |
46 |
| - } |
47 |
| - |
48 |
| - public void setMaxRetries(int maxRetries) { |
49 |
| - this.maxRetries = maxRetries; |
50 |
| - } |
51 |
| - |
52 | 14 | @Override
|
53 | 15 | public String toString() {
|
54 |
| - return String.format("Telegram connections { debugging: %s, skip: %s, retry: %s, max_retries: %d }", |
55 |
| - this.debugging, this.skip, this.retry, this.maxRetries); |
| 16 | + return String.format("%s %s", "Telegram", super.toString()); |
56 | 17 | }
|
57 | 18 | }
|
0 commit comments