-
- 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 ->
hello
world
String Type: PHRASE_QUOTED ->hello
world
"This is quoted string"
String Type: PHRASE ->hello string
word
"Quoted string"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
StringArgument.Type
The type of argument input.
-
Field Summary
Fields Modifier and Type Field Description private final StringArgumentType
type
private final String
name
private final SuggestionAction<T>
suggestion
private 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 StringArgumentType
getType()
Mojang Brigadier argument type. String
getName()
SuggestionAction<T>
getSuggestion()
ContextAction<T>
getAction()
Argument context action String
parse(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
-
-
-
-