Class ArgumentEnum<E extends Enum<E>>
java.lang.Object
io.github.mqzn.commands.arguments.AbstractArgument<E>
io.github.mqzn.commands.arguments.ArgumentEnum<E>
- All Implemented Interfaces:
Argument<E>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.github.mqzn.commands.arguments.AbstractArgument
suggestions
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentEnum
(@NotNull ArgumentData data, Class<E> enumClass) ArgumentEnum
(@NotNull String id, Class<E> enumClass) -
Method Summary
Modifier and TypeMethodDescriptionentries()
<S> E
Parses the raw input into it's argument type The argument type must be registered and defined by the usersetFormat
(@NotNull ArgumentEnum.Format format) changes the type of argument's object to a stringMethods inherited from class io.github.mqzn.commands.arguments.AbstractArgument
asOptional, defaultValue, description, description, equals, hashCode, id, isOptional, setDefaultValue, setOptional, suggest, suggest, suggestions, toString, type, useRemainingSpace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mqzn.commands.arguments.Argument
alternativeTypes, isSuggestionDynamic
-
Constructor Details
-
ArgumentEnum
-
ArgumentEnum
-
-
Method Details
-
setFormat
-
parse
@NotNull public <S> E parse(@NotNull S sender, @NotNull @NotNull String command, @NotNull @NotNull String input) throws ArgumentParseException Description copied from interface:Argument
Parses the raw input into it's argument type The argument type must be registered and defined by the user- Type Parameters:
S
- the sender type- Parameters:
sender
- the sender of the commandcommand
- the commandinput
- the raw argument- Returns:
- the parsed object from raw
- Throws:
ArgumentParseException
- when it fails to parse the raw argument
-
entries
-
toString
Description copied from class:AbstractArgument
changes the type of argument's object to a string
-