Class CommandNode<S extends CommandSource,T extends Argument<S>>
java.lang.Object
studio.mevera.imperat.command.tree.CommandNode<S,T>
- All Implemented Interfaces:
Comparable<CommandNode<S,,?>> Prioritizable
- Direct Known Subclasses:
ArgumentNode,LiteralCommandNode
public abstract class CommandNode<S extends CommandSource,T extends Argument<S>>
extends Object
implements Comparable<CommandNode<S,?>>, Prioritizable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordCommandNode.CompletionCache<S extends CommandSource> -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCommandNode(@Nullable CommandNode<S, ?> parent, T data, int depth, @Nullable CommandPathway<S> executableUsage) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(CommandNode<S, ?> node) intcompareTo(@NotNull CommandNode<S, ?> o) static <S extends CommandSource>
ArgumentNode<S>createArgumentNode(CommandNode<S, ?> parent, Argument<S> data, int depth, @Nullable CommandPathway<S> executableUsage) static <S extends CommandSource>
LiteralCommandNode<S>createCommandNode(@Nullable CommandNode<S, ?> parent, @NotNull Command<S> data, int depth, @Nullable CommandPathway<S> executableUsage) boolean@Nullable CommandNode<S,?> findNode(Predicate<CommandNode<S, ?>> predicate) abstract Stringformat()@Nullable CommandNode<S,?> getChild(Predicate<CommandNode<S, ?>> predicate) PriorityList<CommandNode<S,?>> @NotNull CommandNode.CompletionCache<S>getData()intgetDepth()@Nullable CommandPathway<S>@Nullable CommandPathway<S>CommandNode<S,?> CommandNode<S,?> int@Nullable CommandNode<S,?> inthashCode()booleanbooleanisFlag()booleanbooleanisLast()booleanbooleanbooleanbooleanisRoot()booleanisSecret()Whether this node represents a secret command.booleanparse(int depth, CommandContext<S> ctx) parse(int depth, CommandContext<S> ctx, @Nullable CommandPathway<S> flagScopePathway) parse(int depth, CommandContext<S> ctx, @Nullable CommandPathway<S> flagScopePathway, int requestedTokensToConsume) voidsetCompletionCache(@NotNull CommandNode.CompletionCache<S> completionCache) voidsetExecutableUsage(@Nullable CommandPathway<S> executableUsage) voidsetNearestExecutableUsage(@Nullable CommandPathway<S> nearestExecutableUsage) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface studio.mevera.imperat.util.priority.Prioritizable
getPriority
-
Field Details
-
data
-
executableUsage
-
-
Constructor Details
-
CommandNode
protected CommandNode(@Nullable @Nullable CommandNode<S, ?> parent, @NotNull T data, int depth, @Nullable @Nullable CommandPathway<S> executableUsage)
-
-
Method Details
-
createCommandNode
public static <S extends CommandSource> LiteralCommandNode<S> createCommandNode(@Nullable @Nullable CommandNode<S, ?> parent, @NotNull @NotNull Command<S> data, int depth, @Nullable @Nullable CommandPathway<S> executableUsage) -
createArgumentNode
public static <S extends CommandSource> ArgumentNode<S> createArgumentNode(CommandNode<S, ?> parent, Argument<S> data, int depth, @Nullable @Nullable CommandPathway<S> executableUsage) -
getDepth
public int getDepth() -
getExecutableUsage
-
setExecutableUsage
-
getNearestExecutableUsage
-
setNearestExecutableUsage
-
getCompletionCache
-
setCompletionCache
-
isExecutable
public boolean isExecutable() -
getData
-
addChild
-
getChildren
-
parse
-
parse
public ParseResult<S> parse(int depth, CommandContext<S> ctx, @Nullable @Nullable CommandPathway<S> flagScopePathway) -
parse
public ParseResult<S> parse(int depth, CommandContext<S> ctx, @Nullable @Nullable CommandPathway<S> flagScopePathway, int requestedTokensToConsume) -
format
-
isLast
public boolean isLast() -
isGreedyParam
public boolean isGreedyParam() -
isOptional
public boolean isOptional() -
getChild
-
getNextCommandChild
-
getNextParameterChild
-
isRequired
public boolean isRequired() -
isLiteral
public boolean isLiteral() -
isTrueFlag
public boolean isTrueFlag() -
isFlag
public boolean isFlag() -
isSecret
public boolean isSecret()Whether this node represents a secret command. Only meaningful for literal (command) nodes. -
getParent
-
isRoot
public boolean isRoot() -
getNumberOfParametersToConsume
public int getNumberOfParametersToConsume() -
getPermissionsData
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<S extends CommandSource>
-
findNode
-