Class MappedArgumentWrapper<T,J>
java.lang.Object
org.core.command.argument.arguments.operation.MappedArgumentWrapper<T,J>
- All Implemented Interfaces:
CommandArgument<T>,ParseCommandArgument<T>,SuggestCommandArgument<T>
-
Constructor Summary
ConstructorsConstructorDescriptionMappedArgumentWrapper(CommandArgument<J> commandArgument, Function<? super J,? extends T> convert) -
Method Summary
Modifier and TypeMethodDescriptiongetId()Gets the ID of the command argument.parse(CommandContext context, CommandArgumentContext<T> argument)suggest(CommandContext context, CommandArgumentContext<T> argument)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.core.command.argument.CommandArgument
getUsageMethods inherited from interface org.core.command.argument.SuggestCommandArgument
errorMessage
-
Constructor Details
-
MappedArgumentWrapper
public MappedArgumentWrapper(CommandArgument<J> commandArgument, Function<? super J,? extends T> convert)
-
-
Method Details
-
getId
Description copied from interface:CommandArgumentGets the ID of the command argument. A command argument id needs to be unique within the command, the ID is what separates the arguments. There isn't a standard message structure, however by default the id will be what shows in the usage- Specified by:
getIdin interfaceCommandArgument<T>- Returns:
- a string Id
-
parse
public CommandArgumentResult<T> parse(CommandContext context, CommandArgumentContext<T> argument) throws IOException- Specified by:
parsein interfaceParseCommandArgument<T>- Throws:
IOException
-
suggest
public Collection<String> suggest(CommandContext context, CommandArgumentContext<T> argument) throws NotEnoughArguments- Specified by:
suggestin interfaceSuggestCommandArgument<T>- Throws:
NotEnoughArguments
-