1 | package com.github.netkorp.telegram.framework.annotations; |
||
0 ignored issues
–
show
Code Smell
introduced
by
![]() |
|||
2 | |||
3 | import org.springframework.stereotype.Component; |
||
4 | import org.springframework.stereotype.Indexed; |
||
5 | |||
6 | import java.lang.annotation.Documented; |
||
7 | import java.lang.annotation.ElementType; |
||
8 | import java.lang.annotation.Retention; |
||
9 | import java.lang.annotation.RetentionPolicy; |
||
10 | import java.lang.annotation.Target; |
||
11 | |||
12 | /** |
||
13 | * Indicates that the annotated element represents a command that could be executed by the user. |
||
14 | * It should be used in classes that implement the |
||
15 | * {@link com.github.netkorp.telegram.framework.commands.interfaces.Command} interface. |
||
16 | * |
||
17 | * @see com.github.netkorp.telegram.framework.commands.abstracts.AbstractSimpleCommand |
||
18 | * @see com.github.netkorp.telegram.framework.commands.abstracts.AbstractMultistageCommand |
||
19 | */ |
||
20 | @Target(ElementType.TYPE) |
||
21 | @Retention(RetentionPolicy.RUNTIME) |
||
22 | @Documented |
||
23 | @Indexed |
||
24 | @Component |
||
25 | public @interface TelegramCommand { |
||
0 ignored issues
–
show
|
|||
26 | |||
27 | /** |
||
28 | * Returns the names of the command that will be used to invoke it. |
||
29 | * |
||
30 | * @return the names of the command. |
||
31 | */ |
||
32 | String[] name(); |
||
0 ignored issues
–
show
|
|||
33 | |||
34 | /** |
||
35 | * Indicates the group of commands where the command will be included, if any; empty String otherwise. |
||
36 | * |
||
37 | * @return the name of the group. |
||
38 | */ |
||
39 | String group() default ""; |
||
40 | |||
41 | /** |
||
42 | * Returns the description of the command. |
||
43 | * |
||
44 | * @return the description of the command. |
||
45 | */ |
||
46 | String description() default ""; |
||
47 | |||
48 | /** |
||
49 | * Returns {@code true} if the command is secure. |
||
50 | * |
||
51 | * @return {@code true} if the command is secure; {@code false} otherwise. By default the command is secure. |
||
52 | */ |
||
53 | boolean secure() default true; |
||
54 | } |