Class CommandSyntax<S>

java.lang.Object
io.github.mqzn.commands.base.syntax.CommandSyntax<S>
All Implemented Interfaces:
TextConvertible<S>

public final class CommandSyntax<S> extends Object implements TextConvertible<S>
  • Method Details

    • isArgRequired

      public static boolean isArgRequired(String argSyntax)
    • isArgOptional

      public static boolean isArgOptional(String argSyntax)
    • isArgLiteral

      public static boolean isArgLiteral(String argSyntax)
    • fetchArgId

      public static String fetchArgId(String argSyntax)
    • getArgument

      @Nullable public @Nullable Argument<?> getArgument(int index)
    • setInfo

      public void setInfo(@NotNull @NotNull String permission, @NotNull @NotNull String description)
    • addFlag

      public void addFlag(String flag)
    • length

      public int length()
    • withoutOptionalLength

      public int withoutOptionalLength()
    • withoutFlagsOrOptionalArgumentsLength

      public int withoutFlagsOrOptionalArgumentsLength()
    • matchesContext

      public boolean matchesContext(@NotNull @NotNull DelegateCommandContext<S> commandContext)
      Checks if the syntax matches the context input Here are some examples:
      Parameters:
      commandContext - the input
      Returns:
      whether the syntax is suitable for the context used !
    • useSpace

      public boolean useSpace()
    • getArguments

      @NotNull public @NotNull List<Argument<?>> getArguments()
    • execute

      public <C> void execute(C sender, CommandContext<S> commandContext)
    • formatted

      public String formatted(CommandManager<?,S> commandManager)
    • toText

      @NonNull public @NonNull net.kyori.adventure.text.TextComponent toText(@NotNull @NotNull CommandManager<?,S> manager, @NotNull S sender)
      Specified by:
      toText in interface TextConvertible<S>
    • setInfo

      public void setInfo(@Nullable @Nullable Information info)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object