Class OptionalArgument<T>
java.lang.Object
org.core.command.argument.arguments.operation.OptionalArgument<T>
- All Implemented Interfaces:
CommandArgument<T>
,ParseCommandArgument<T>
,SuggestCommandArgument<T>
- Direct Known Subclasses:
SourceOrLivePlayerArgument
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionOptionalArgument(CommandArgument<T> arg, ParseCommandArgument<T> value)
OptionalArgument(CommandArgument<T> arg, T value)
-
Method Summary
Modifier and TypeMethodDescriptiongetId()
Gets the ID of the command argument.getUsage()
Gets the usage of the argumentparse(CommandContext context, CommandArgumentContext<T> argument)
suggest(CommandContext commandContext, CommandArgumentContext<T> argument)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.core.command.argument.SuggestCommandArgument
errorMessage
-
Constructor Details
-
OptionalArgument
-
OptionalArgument
-
-
Method Details
-
getId
Description copied from interface:CommandArgument
Gets 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:
getId
in interfaceCommandArgument<T>
- Returns:
- a string Id
-
getUsage
Description copied from interface:CommandArgument
Gets the usage of the argument- Specified by:
getUsage
in interfaceCommandArgument<T>
- Returns:
- a string version of the usage of the argument
-
getOriginalArgument
-
parse
public CommandArgumentResult<T> parse(CommandContext context, CommandArgumentContext<T> argument) throws IOException- Specified by:
parse
in interfaceParseCommandArgument<T>
- Throws:
IOException
-
suggest
public Collection<String> suggest(CommandContext commandContext, CommandArgumentContext<T> argument) throws NotEnoughArguments- Specified by:
suggest
in interfaceSuggestCommandArgument<T>
- Throws:
NotEnoughArguments
-