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
  • Field Details

  • 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

      @Nullable public @Nullable CommandPathway<S> getExecutableUsage()
    • setExecutableUsage

      public void setExecutableUsage(@Nullable @Nullable CommandPathway<S> executableUsage)
    • getNearestExecutableUsage

      @Nullable public @Nullable CommandPathway<S> getNearestExecutableUsage()
    • setNearestExecutableUsage

      public void setNearestExecutableUsage(@Nullable @Nullable CommandPathway<S> nearestExecutableUsage)
    • getCompletionCache

      @NotNull public @NotNull CommandNode.CompletionCache<S> getCompletionCache()
    • setCompletionCache

      public void setCompletionCache(@NotNull @NotNull CommandNode.CompletionCache<S> completionCache)
    • isExecutable

      public boolean isExecutable()
    • getData

      @NotNull public T getData()
    • addChild

      public void addChild(CommandNode<S,?> node)
    • getChildren

      public PriorityList<CommandNode<S,?>> getChildren()
    • parse

      public ParseResult<S> parse(int depth, CommandContext<S> ctx)
    • 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

      public abstract String format()
    • isLast

      public boolean isLast()
    • isGreedyParam

      public boolean isGreedyParam()
    • isOptional

      public boolean isOptional()
    • getChild

      @Nullable public @Nullable CommandNode<S,?> getChild(Predicate<CommandNode<S,?>> predicate)
    • getNextCommandChild

      public CommandNode<S,?> getNextCommandChild()
    • getNextParameterChild

      public CommandNode<S,?> 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

      @Nullable public @Nullable CommandNode<S,?> getParent()
    • isRoot

      public boolean isRoot()
    • getNumberOfParametersToConsume

      public int getNumberOfParametersToConsume()
    • getPermissionsData

      public PermissionsData getPermissionsData()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(@NotNull @NotNull CommandNode<S,?> o)
      Specified by:
      compareTo in interface Comparable<S extends CommandSource>
    • findNode

      @Nullable public @Nullable CommandNode<S,?> findNode(Predicate<CommandNode<S,?>> predicate)