Class StringParserArgument<P>
java.lang.Object
org.core.command.argument.arguments.operation.StringParserArgument<P>
- All Implemented Interfaces:
CommandArgument<P>,ParseCommandArgument<P>,SuggestCommandArgument<P>
-
Constructor Summary
ConstructorsConstructorDescriptionStringParserArgument(String id, ParseCommandArgument<StringParser<P>> function, BiFunction<? super CommandArgumentContext<P>,? super StringParser<P>,String> failMessage) -
Method Summary
Modifier and TypeMethodDescriptiongetId()Gets the ID of the command argument.parse(CommandContext context, CommandArgumentContext<P> argument)suggest(CommandContext commandContext, CommandArgumentContext<P> 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
-
StringParserArgument
public StringParserArgument(String id, ParseCommandArgument<StringParser<P>> function, BiFunction<? super CommandArgumentContext<P>,? super StringParser<P>,String> failMessage)
-
-
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<P>- Returns:
- a string Id
-
parse
public CommandArgumentResult<P> parse(CommandContext context, CommandArgumentContext<P> argument) throws IOException- Specified by:
parsein interfaceParseCommandArgument<P>- Throws:
IOException
-
suggest
- Specified by:
suggestin interfaceSuggestCommandArgument<P>
-