Class CommandSyntax<S>
java.lang.Object
io.github.mqzn.commands.base.syntax.CommandSyntax<S>
- All Implemented Interfaces:
TextConvertible<S>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
<C> void
execute
(C sender, CommandContext<S> commandContext) static String
fetchArgId
(String argSyntax) formatted
(CommandManager<?, S> commandManager) @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:void
void
setInfo
(@Nullable Information info) @NonNull net.kyori.adventure.text.TextComponent
toText
(@NotNull CommandManager<?, S> manager, S sender) boolean
useSpace()
int
int
-
Method Details
-
isArgRequired
-
isArgOptional
-
isArgLiteral
-
fetchArgId
-
getArgument
-
setInfo
-
addFlag
-
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
-
formatted
-
toText
@NonNull public @NonNull net.kyori.adventure.text.TextComponent toText(@NotNull @NotNull CommandManager<?, S> manager, @NotNull S sender) - Specified by:
toText
in interfaceTextConvertible<S>
-
setInfo
-
equals
-
hashCode
public int hashCode()
-