Class StringContext
java.lang.Object
net.lucypoulton.squirtgun.command.context.StringContext
- All Implemented Interfaces:
CommandContext
A command context that parses a raw string.
-
Constructor Summary
ConstructorsConstructorDescriptionStringContext(FormatProvider provider, PermissionHolder target, CommandNode<?> node, String value) -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.Componentexecute()Executes the command.@Nullable ObjectgetArgumentValue(String name) Gets the value of an argument by name.<U> UgetArgumentValue(CommandArgument<U> name) Gets the value of an argument.@NotNull FormatProviderGets the format provider to use in message decoration.getRaw()Gets the raw input given to this context.CommandNode<?>getTail()Gets the last node in the chain that has been reached.Gets this command context's target.Gets a list of entries for tab completion.
-
Constructor Details
-
StringContext
public StringContext(FormatProvider provider, PermissionHolder target, CommandNode<?> node, String value)
-
-
Method Details
-
getTarget
Description copied from interface:CommandContextGets this command context's target.- Specified by:
getTargetin interfaceCommandContext
-
getArgumentValue
Description copied from interface:CommandContextGets the value of an argument.- Specified by:
getArgumentValuein interfaceCommandContext- Parameters:
name- the argument to get the value for- Returns:
- the value if available - if unset then null
-
getArgumentValue
Description copied from interface:CommandContextGets the value of an argument by name.- Specified by:
getArgumentValuein interfaceCommandContext- Parameters:
name- the name of the argument to get the value for- Returns:
- the value if available, if unset then null.
-
getRaw
Description copied from interface:CommandContextGets the raw input given to this context.- Specified by:
getRawin interfaceCommandContext
-
getFormat
Description copied from interface:CommandContextGets the format provider to use in message decoration.- Specified by:
getFormatin interfaceCommandContext
-
tabComplete
Description copied from interface:CommandContextGets a list of entries for tab completion.- Specified by:
tabCompletein interfaceCommandContext
-
execute
public net.kyori.adventure.text.Component execute()Description copied from interface:CommandContextExecutes the command.- Specified by:
executein interfaceCommandContext
-
getTail
Description copied from interface:CommandContextGets the last node in the chain that has been reached.- Specified by:
getTailin interfaceCommandContext
-