public final class ByteParameterType extends java.lang.Object implements ParameterType<CommandActor,java.lang.Byte>
ParameterType for parsing byte typesParameterType.Factory<A extends CommandActor>| Constructor and Description |
|---|
ByteParameterType() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Byte |
parse(@NotNull MutableStringStream input,
@NotNull ExecutionContext<CommandActor> context)
Reads input from the given
MutableStringStream, parses the object, or throws
exceptions if needed. |
@NotNull PrioritySpec |
parsePriority()
The priority for an argument of this type over other candidate arguments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefaultSuggestions, isGreedypublic java.lang.Byte parse(@NotNull
@NotNull MutableStringStream input,
@NotNull
@NotNull ExecutionContext<CommandActor> context)
ParameterTypeMutableStringStream, parses the object, or throws
exceptions if needed.
Note: Lamp makes no guarantees about the times it may invoke this method. It may be called repeatedly for execution, tab completion, finding execution candidates, etc.
As such, it's important to implement the parse method with the following in mind:
CommandErrorException)parse in interface ParameterType<CommandActor,java.lang.Byte>input - The input stream. This argument type is free to consume as much as it needscontext - The command execution context, as well as arguments that have been resolved@NotNull public @NotNull PrioritySpec parsePriority()
ParameterTypeAn example of this, is when a command has the following signatures:
Because an integer parameter can only accept a certain type of input (i.e. numbers),
it will have higher priority over a string parameter, and as such, if the user
inputs /foo 10, the integer will be tested first, before moving on to the
string.
For more details on the priority API, see PrioritySpec
parsePriority in interface ParameterType<CommandActor,java.lang.Byte>PrioritySpec