Package dev.jorel.commandapi
Class AbstractArgumentTree<Impl extends AbstractArgumentTree<Impl,Argument,CommandSender>,Argument extends AbstractArgument<?,?,Argument,CommandSender>,CommandSender>
java.lang.Object
dev.jorel.commandapi.AbstractArgumentTree<Impl,Argument,CommandSender>
- Type Parameters:
Impl- The class extending this class, used as the return type for chain callsCommandSender- The CommandSender class used by the class extending this class
- All Implemented Interfaces:
ChainableBuilder<Impl>
- Direct Known Subclasses:
AbstractArgument
public abstract class AbstractArgumentTree<Impl extends AbstractArgumentTree<Impl,Argument,CommandSender>,Argument extends AbstractArgument<?,?,Argument,CommandSender>,CommandSender>
extends Object
This is a base class for arguments, allowing them to behave as tree nodes in
a
AbstractCommandTree-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandAPIExecutor<CommandSender,AbstractCommandSender<? extends CommandSender>> The CommandAPIExecutor for this executable implementation -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiates anAbstractArgumentTree.protectedAbstractArgumentTree(Argument argument) Instantiates anAbstractArgumentTreewith an underlying argument. -
Method Summary
Modifier and TypeMethodDescriptionClear all executors from the current command builderReturns the executors that this command hasvoidsetExecutor(CommandAPIExecutor<CommandSender, AbstractCommandSender<? extends CommandSender>> executor) Sets the executors for this commandthen(AbstractArgumentTree<?, Argument, CommandSender> tree) Create a child branch on this nodeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.jorel.commandapi.ChainableBuilder
instance
-
Field Details
-
executor
The CommandAPIExecutor for this executable implementation
-
-
Constructor Details
-
AbstractArgumentTree
protected AbstractArgumentTree()Instantiates anAbstractArgumentTree. This can only be called if the class that extends this is anAbstractArgument -
AbstractArgumentTree
Instantiates anAbstractArgumentTreewith an underlying argument.- Parameters:
argument- the argument to use as the underlying argument for this argument tree
-
-
Method Details
-
then
Create a child branch on this node- Parameters:
tree- The child branch- Returns:
- this tree node
-
getExecutor
public CommandAPIExecutor<CommandSender,AbstractCommandSender<? extends CommandSender>> getExecutor()Returns the executors that this command has- Returns:
- the executors that this command has
-
setExecutor
public void setExecutor(CommandAPIExecutor<CommandSender, AbstractCommandSender<? extends CommandSender>> executor) Sets the executors for this command- Parameters:
executor- the executors for this command
-
clearExecutors
Clear all executors from the current command builder- Returns:
- this command builder
-