Class StringContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
java.lang.Object
me.lucyy.squirtgun.command.context.StringContext<T>
- All Implemented Interfaces:
CommandContext<T>
public class StringContext<T extends me.lucyy.squirtgun.platform.PermissionHolder> extends java.lang.Object implements CommandContext<T>
A command context that parses a raw string.
-
Constructor Summary
Constructors Constructor Description StringContext(me.lucyy.squirtgun.format.FormatProvider provider, T target, CommandNode<T> node, java.lang.String value) -
Method Summary
Modifier and Type Method Description net.kyori.adventure.text.Componentexecute()Executes the command.@Nullable java.lang.ObjectgetArgumentValue(java.lang.String name)Gets the value of an argument by name.<U> UgetArgumentValue(CommandArgument<U> name)Gets the value of an argument.@NotNull me.lucyy.squirtgun.format.FormatProvidergetFormat()Gets the format provider to use in message decoration.java.lang.StringgetRaw()Gets the raw input given to this context.CommandNode<T>getTail()Gets the last node in the chain that has been reached.TgetTarget()Gets this command context's target.java.util.List<java.lang.String>tabComplete()Gets the string to be shown in the tabcompleter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
StringContext
public StringContext(me.lucyy.squirtgun.format.FormatProvider provider, T target, CommandNode<T> node, java.lang.String value)
-
-
Method Details
-
getTarget
Description copied from interface:CommandContextGets this command context's target.- Specified by:
getTargetin interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
getArgumentValue
Description copied from interface:CommandContextGets the value of an argument.- Specified by:
getArgumentValuein interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>- Parameters:
name- the argument to get the value for- Returns:
- the value if available - if unset then null
-
getArgumentValue
@Nullable public @Nullable java.lang.Object getArgumentValue(java.lang.String name)Description copied from interface:CommandContextGets the value of an argument by name.- Specified by:
getArgumentValuein interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>- Parameters:
name- the name of the argument to get the value for- Returns:
- the value if available, if unset then null.
-
getRaw
public java.lang.String getRaw()Description copied from interface:CommandContextGets the raw input given to this context.- Specified by:
getRawin interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
getFormat
@NotNull public @NotNull me.lucyy.squirtgun.format.FormatProvider getFormat()Description copied from interface:CommandContextGets the format provider to use in message decoration.- Specified by:
getFormatin interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
tabComplete
public java.util.List<java.lang.String> tabComplete()Description copied from interface:CommandContextGets the string to be shown in the tabcompleter.- Specified by:
tabCompletein interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
execute
public net.kyori.adventure.text.Component execute()Description copied from interface:CommandContextExecutes the command.- Specified by:
executein interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
getTail
Description copied from interface:CommandContextGets the last node in the chain that has been reached.- Specified by:
getTailin interfaceCommandContext<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-