E - The type of the executorT - The enum typepublic class EnumType<E,T extends java.lang.Enum<T>> extends java.lang.Object implements ArgumentType<E,T>
| Modifier and Type | Method and Description |
|---|---|
int |
getWeight() |
static <E,T extends java.lang.Enum<T>> |
of(java.lang.Class<T> enumClass)
Create a new enum type.
|
void |
parseCompletions(java.util.Set<java.lang.String> completions,
ExecutionContext<E> executionContext,
StringReader stringReader)
Provide the completions of this argument.
|
T |
parseValue(ExecutionContext<E> executionContext,
StringReader stringReader)
Parses the value of the argument.
|
public static <E,T extends java.lang.Enum<T>> EnumType<E,T> of(java.lang.Class<T> enumClass)
E - The type of the executorT - The enum typeenumClass - The enum classpublic int getWeight()
getWeight in interface ArgumentType<E,T extends java.lang.Enum<T>>@Nonnull public T parseValue(ExecutionContext<E> executionContext, StringReader stringReader) throws ArgumentParseException, java.lang.RuntimeException
ArgumentTypeparseValue in interface ArgumentType<E,T extends java.lang.Enum<T>>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,T extends java.lang.Enum<T>>completions - The set of completionsexecutionContext - The execution contextstringReader - The string reader