Class CommandSyntax<S>
java.lang.Object
io.github.mqzn.commands.base.syntax.CommandSyntax<S>
- All Implemented Interfaces:
TextConvertible<S>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
debug()
boolean
void
execute
(S sender, CommandContext<S> commandContext) static String
fetchArgId
(String argSyntax) @Nullable Argument<?>
getArgument
(int index) int
hashCode()
static boolean
isArgLiteral
(String argSyntax) static boolean
isArgOptional
(String argSyntax) static boolean
isArgRequired
(String argSyntax) int
length()
boolean
matchesContext
(@NotNull DelegateCommandContext<S> commandContext) Checks if the syntax matches the context input Here are some examples:static <S> @NotNull CommandSyntax<S>
of
(@NotNull CommandManager<?, S> manager, @NotNull String commandLabel, @NotNull CommandExecution<S> execution, @NotNull Argument<?>... args) static <S> @NotNull CommandSyntax<S>
of
(@NotNull CommandManager<?, S> manager, @NotNull String commandLabel, @NotNull CommandExecution<S> execution, @NotNull SyntaxFlags flags, @NotNull Argument<?>... args) @NonNull net.kyori.adventure.text.TextComponent
boolean
useSpace()
int
int
-
Method Details
-
of
@NotNull public static <S> @NotNull CommandSyntax<S> of(@NotNull @NotNull CommandManager<?, S> manager, @NotNull @NotNull String commandLabel, @NotNull @NotNull CommandExecution<S> execution, @NotNull @NotNull Argument<?>... args) -
of
@NotNull public static <S> @NotNull CommandSyntax<S> of(@NotNull @NotNull CommandManager<?, S> manager, @NotNull @NotNull String commandLabel, @NotNull @NotNull CommandExecution<S> execution, @NotNull @NotNull SyntaxFlags flags, @NotNull @NotNull Argument<?>... args) -
isArgRequired
-
isArgOptional
-
isArgLiteral
-
fetchArgId
-
getArgument
-
withInfo
public CommandSyntax<S> withInfo(@NotNull @NotNull String permission, @NotNull @NotNull String description) -
withFlag
-
length
public int length() -
withoutOptionalLength
public int withoutOptionalLength() -
withoutFlagsOrOptionalArgumentsLength
public int withoutFlagsOrOptionalArgumentsLength() -
matchesContext
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
-
execute
-
debug
public void debug() -
formatted
-
toText
- Specified by:
toText
in interfaceTextConvertible<S>
-
equals
-
hashCode
public int hashCode()
-