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 String
protected final @Nullable CommandExecution<S,
?> protected final @NotNull SyntaxFlags
protected @Nullable Information
protected final @NotNull Class<?>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
int
compareTo
(@NotNull CommandSyntax<S> other) boolean
<C> void
execute
(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 SyntaxFlags
getFlags()
@Nullable Information
getInfo()
@NotNull Class<?>
boolean
int
hashCode()
boolean
int
length()
boolean
matchesContext
(@NotNull DelegateCommandContext<S> commandContext) Checks if the syntax matches the context inputvoid
setInfo
(@Nullable Information info) toString()
@NotNull net.kyori.adventure.text.TextComponent
toText
(@NotNull CommandManager<?, S> manager, S sender) boolean
useSpace()
-
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:
toText
in interfaceTextConvertible<S>
-
isSubCommand
public boolean isSubCommand() -
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<S>
-