E - The type of the executorpublic class IntegerType<E> extends java.lang.Object implements ArgumentType<E,java.lang.Integer>
| Modifier and Type | Method and Description |
|---|---|
int |
getWeight() |
static <E> IntegerType<E> |
integer()
Create a new integer type with no min and max value.
|
static <E> IntegerType<E> |
integer(int min,
int max)
Create a new integer type with a min and max value.
|
static <E> IntegerType<E> |
maxInteger(int max)
Create a new integer type with a max value.
|
static <E> IntegerType<E> |
minInteger(int min)
Create a new integer type with a min value.
|
void |
parseCompletions(java.util.Set<java.lang.String> completions,
ExecutionContext<E> executionContext,
StringReader stringReader)
Provide the completions of this argument.
|
java.lang.Integer |
parseValue(ExecutionContext<E> executionContext,
StringReader stringReader)
Parses the value of the argument.
|
public static <E> IntegerType<E> integer()
Integer.MIN_VALUE and Integer.MAX_VALUE are allowed.E - The type of the executorpublic static <E> IntegerType<E> minInteger(int min)
min and Integer.MAX_VALUE are allowed.E - The type of the executormin - The min valuepublic static <E> IntegerType<E> maxInteger(int max)
Integer.MIN_VALUE and max are allowed.E - The type of the executormax - The max valuepublic static <E> IntegerType<E> integer(int min, int max)
min and max are allowed.E - The type of the executormin - The min valuemax - The max valuepublic int getWeight()
getWeight in interface ArgumentType<E,java.lang.Integer>@Nonnull public java.lang.Integer parseValue(ExecutionContext<E> executionContext, StringReader stringReader) throws ArgumentParseException, java.lang.RuntimeException
ArgumentTypeparseValue in interface ArgumentType<E,java.lang.Integer>executionContext - The execution contextstringReader - The string readerArgumentParseException - If the value could not be parsedjava.lang.RuntimeException - If an unexpected error occurredpublic void parseCompletions(java.util.Set<java.lang.String> completions,
ExecutionContext<E> executionContext,
StringReader stringReader)
ArgumentTypeparseCompletions in interface ArgumentType<E,java.lang.Integer>completions - The set of completionsexecutionContext - The execution contextstringReader - The string reader