@ApiStatus.Internal public enum RangeChecker extends java.lang.Enum<RangeChecker> implements ParameterValidator<CommandActor,java.lang.Number>
@Range annotation.| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
void |
validate(@NotNull CommandActor actor,
java.lang.Number value,
@NotNull ParameterNode<CommandActor,java.lang.Number> parameter,
@NotNull Lamp<CommandActor> lamp)
Validates the specified value that was passed to a parameter.
|
static RangeChecker |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static RangeChecker[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RangeChecker INSTANCE
public static RangeChecker[] values()
for (RangeChecker c : RangeChecker.values()) System.out.println(c);
public static RangeChecker valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic void validate(@NotNull
@NotNull CommandActor actor,
java.lang.Number value,
@NotNull
@NotNull ParameterNode<CommandActor,java.lang.Number> parameter,
@NotNull
@NotNull Lamp<CommandActor> lamp)
ParameterValidator
Ideally, a validator will want to throw an exception when the parameter is
not valid, and then further handled with CommandExceptionHandler.
validate in interface ParameterValidator<CommandActor,java.lang.Number>actor - The command actorvalue - The parameter value. May or may not be null, depending on the resolver.parameter - The parameter that will take this value