Class CommandSyntax<S>
java.lang.Object
io.github.mqzn.commands.base.syntax.CommandSyntax<S>
- All Implemented Interfaces:
TextConvertible<S>,Comparable<CommandSyntax<S>>
- Direct Known Subclasses:
SubCommandSyntax
public class CommandSyntax<S>
extends Object
implements TextConvertible<S>, Comparable<CommandSyntax<S>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull Stringprotected final @Nullable CommandExecution<S,?> protected final @NotNull SyntaxFlagsprotected @Nullable Informationprotected final @NotNull Class<?> -
Method Summary
Modifier and TypeMethodDescriptionvoidintcompareTo(@NotNull CommandSyntax<S> other) boolean<C> voidexecute(C sender, CommandContext<S> commandContext) @Nullable Argument<?>getArgument(int index) getArguments(io.github.mqzn.commands.base.syntax.tree.CommandTree<S> tree, CommandSyntax<S> syntax) @NotNull String@Nullable CommandExecution<S,?> @NotNull SyntaxFlagsgetFlags()@Nullable InformationgetInfo()@NotNull Class<?>booleaninthashCode()booleanintlength()booleanmatchesContext(@NotNull DelegateCommandContext<S> commandContext) Checks if the syntax matches the context inputvoidsetInfo(@Nullable Information info) toString()@NotNull net.kyori.adventure.text.TextComponenttoText(@NotNull CommandManager<?, S> manager, S sender) booleanuseSpace()
-
Field Details
-
arguments
-
execution
-
senderClass
-
commandLabel
-
flags
-
info
-
-
Method Details
-
getArguments
public static <S> List<Argument<?>> getArguments(io.github.mqzn.commands.base.syntax.tree.CommandTree<S> tree, CommandSyntax<S> syntax) -
getSenderClass
-
getExecution
-
getInfo
-
setInfo
-
getFlags
-
getCommandLabel
-
getArgument
-
addFlag
-
length
public int length() -
matchesContext
Checks if the syntax matches the context input- Parameters:
commandContext- the input- Returns:
- whether the syntax is suitable for the context used !
-
useSpace
public boolean useSpace() -
getArguments
-
hasArg
-
execute
-
toText
@NotNull public @NotNull net.kyori.adventure.text.TextComponent toText(@NotNull @NotNull CommandManager<?, S> manager, @NotNull S sender) - Specified by:
toTextin interfaceTextConvertible<S>
-
isSubCommand
public boolean isSubCommand() -
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<S>
-