Class ParameterNode<S extends Source,T extends CommandParameter<S>>

java.lang.Object
studio.mevera.imperat.command.tree.ParameterNode<S,T>
Direct Known Subclasses:
ArgumentNode, CommandNode

public abstract class ParameterNode<S extends Source,T extends CommandParameter<S>> extends Object
  • Field Details

  • Constructor Details

    • ParameterNode

      protected ParameterNode(@Nullable @Nullable ParameterNode<S,?> parent, @NotNull T data, int depth, @Nullable @Nullable CommandUsage<S> executableUsage)
  • Method Details

    • createCommandNode

      public static <S extends Source> CommandNode<S> createCommandNode(@Nullable @Nullable ParameterNode<S,?> parent, @NotNull @NotNull Command<S> data, int depth, @Nullable @Nullable CommandUsage<S> executableUsage)
    • createArgumentNode

      public static <S extends Source> ArgumentNode<S> createArgumentNode(ParameterNode<S,?> parent, CommandParameter<S> data, int depth, @Nullable @Nullable CommandUsage<S> executableUsage)
    • getPermission

      public String getPermission()
    • setPermission

      public void setPermission(String permission)
    • getDepth

      public int getDepth()
    • getExecutableUsage

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

      public void setExecutableUsage(@Nullable @Nullable CommandUsage<S> executableUsage)
    • isExecutable

      public boolean isExecutable()
    • getData

      @NotNull public T getData()
    • addChild

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

      public LinkedList<ParameterNode<S,?>> getChildren()
    • matchesInput

      public boolean matchesInput(int depth, Context<S> ctx)
    • matchesInput

      public boolean matchesInput(int depth, Context<S> ctx, boolean strict)
    • addSupportedType

      public void addSupportedType(ParameterType<S,?> type)
    • removeSupportedType

      public void removeSupportedType(ParameterType<S,?> type)
    • getSupportedTypes

      public Deque<ParameterType<S,?>> getSupportedTypes()
    • getPrimaryType

      @Nullable public @Nullable ParameterType<S,?> getPrimaryType()
    • format

      public abstract String format()
    • isLast

      public boolean isLast()
    • priority

      public abstract int priority()
    • isGreedyParam

      public boolean isGreedyParam()
    • isOptional

      public boolean isOptional()
    • getChild

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

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

      public ParameterNode<S,?> getNextParameterChild()
    • isRequired

      public boolean isRequired()
    • isCommand

      public boolean isCommand()
    • isTrueFlag

      public boolean isTrueFlag()
    • isFlag

      public boolean isFlag()
    • getParent

      @Nullable public @Nullable ParameterNode<S,?> getParent()
    • getTopChild

      @Nullable public @Nullable ParameterNode<S,?> getTopChild()
    • isRoot

      public boolean isRoot()
    • getConsumedArguments

      public int getConsumedArguments()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object