-
Notifications
You must be signed in to change notification settings - Fork 0
/
Command.java
48 lines (41 loc) · 1.14 KB
/
Command.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package net.jailgens.enchanted.annotations;
import net.jailgens.enchanted.CommandFactory;
import org.intellij.lang.annotations.Pattern;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static net.jailgens.enchanted.Command.NAME_PATTERN;
/**
* Marks a method, or class as a command for the {@link CommandFactory}.
*
* @author Sparky983
* @since 0.0.0
*/
@Documented
@Retention(RUNTIME)
@Target({METHOD, TYPE})
public @interface Command {
/**
* The name of the command.
*
* @return the name of the command.
* @since 0.0.0
*/
@Contract(pure = true)
@Pattern(NAME_PATTERN)
@NotNull String value();
/**
* Marks a method as a default command for the {@link CommandFactory}.
*
* @since 0.0.0
*/
@Retention(RUNTIME)
@Target(METHOD)
@interface Default {
}
}