Class AnyArgument<A>
java.lang.Object
org.core.command.argument.arguments.operation.AnyArgument<A>
- All Implemented Interfaces:
CommandArgument<A>
,ParseCommandArgument<A>
,SuggestCommandArgument<A>
-
Constructor Summary
ConstructorDescriptionAnyArgument(String id, Function<? super A,String> toString, BiFunction<? super Collection<A>,? super String,? extends A> fromString, A... array)
AnyArgument(String id, Function<? super A,String> toString, BiFunction<? super Collection<A>,? super String,? extends A> fromString, Collection<A> collection)
AnyArgument(String id, Function<? super A,String> toString, BiFunction<? super Collection<A>,? super String,? extends A> fromString, BiFunction<? super CommandContext,? super CommandArgumentContext<A>,? extends Collection<A>> supply)
-
Method Summary
Modifier and TypeMethodDescriptiongetId()
Gets the ID of the command argument.parse(CommandContext context, CommandArgumentContext<A> argument)
suggest(CommandContext context, CommandArgumentContext<A> 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.CommandArgument
getUsage
Methods inherited from interface org.core.command.argument.SuggestCommandArgument
errorMessage
-
Constructor Details
-
AnyArgument
@SafeVarargs public AnyArgument(String id, Function<? super A,String> toString, BiFunction<? super Collection<A>,? super String,? extends A> fromString, A... array) -
AnyArgument
public AnyArgument(String id, Function<? super A,String> toString, BiFunction<? super Collection<A>,? super String,? extends A> fromString, Collection<A> collection) -
AnyArgument
public AnyArgument(String id, Function<? super A,String> toString, BiFunction<? super Collection<A>,? super String,? extends A> fromString, BiFunction<? super CommandContext,? super CommandArgumentContext<A>,? extends Collection<A>> supply)
-
-
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<A>
- Returns:
- a string Id
-
parse
public CommandArgumentResult<A> parse(CommandContext context, CommandArgumentContext<A> argument) throws IOException- Specified by:
parse
in interfaceParseCommandArgument<A>
- Throws:
IOException
-
suggest
- Specified by:
suggest
in interfaceSuggestCommandArgument<A>
-