Class IdentifiableArgument<I extends Identifiable>
java.lang.Object
org.core.command.argument.arguments.id.IdentifiableArgument<I>
- Type Parameters:
I- The return class type of the argument
- All Implemented Interfaces:
CommandArgument<I>,ParseCommandArgument<I>,SuggestCommandArgument<I>
- Direct Known Subclasses:
BlockGroupArgument,BlockTypeArgument
public abstract class IdentifiableArgument<I extends Identifiable>
extends Object
implements CommandArgument<I>
Gets a single identifiable object from the collection provided by
getAll()-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Collection<I>getAll()Gets all possible values that the argument could begetId()Gets the ID of the command argument.parse(CommandContext context, CommandArgumentContext<I> argument)suggest(CommandContext context, CommandArgumentContext<I> 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
-
IdentifiableArgument
-
-
Method Details
-
getAll
Gets all possible values that the argument could be- Returns:
- A collection of all possible values
-
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<I extends Identifiable>- Returns:
- a string Id
-
parse
public CommandArgumentResult<I> parse(CommandContext context, CommandArgumentContext<I> argument) throws IOException- Specified by:
parsein interfaceParseCommandArgument<I extends Identifiable>- Throws:
IOException
-
suggest
- Specified by:
suggestin interfaceSuggestCommandArgument<I extends Identifiable>
-