-
- All Implemented Interfaces:
-
dev.kotx.flylib.command.Argument
public final class StringArgument<T extends Object> implements Argument<String, T>
String argument type. You can specify string type. If it is not the specified type, an error will be displayed on the client side and the attempt to execute will not be accepted. String Type: WORD ->
helloworldString Type: PHRASE_QUOTED ->helloworld"This is quoted string"String Type: PHRASE ->hello stringword"Quoted string"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumStringArgument.TypeThe type of argument input.
-
Field Summary
Fields Modifier and Type Field Description private final StringArgumentTypetypeprivate final Stringnameprivate final SuggestionAction<T>suggestionprivate final ContextAction<T>action
-
Constructor Summary
Constructors Constructor Description StringArgument(String name, StringArgument.Type type, SuggestionAction<T> suggestion, ContextAction<T> action)
-
Method Summary
Modifier and Type Method Description StringArgumentTypegetType()Mojang Brigadier argument type. StringgetName()SuggestionAction<T>getSuggestion()ContextAction<T>getAction()Argument context action Stringparse(CommandContext<CommandListenerWrapper> context, String key)-
-
Constructor Detail
-
StringArgument
StringArgument(String name, StringArgument.Type type, SuggestionAction<T> suggestion, ContextAction<T> action)
- Parameters:
name- Name of argument.type- Text type.suggestion- Lambda expression for tab completion of its arguments.
-
-
Method Detail
-
getType
StringArgumentType getType()
Mojang Brigadier argument type.
-
getSuggestion
SuggestionAction<T> getSuggestion()
-
getAction
ContextAction<T> getAction()
Argument context action
-
-
-
-