-
- All Implemented Interfaces:
-
dev.kotx.flylib.command.Argument
public final class BooleanArgument<T extends Object> implements Argument<Boolean, T>
Boolean argument. It must take true or false. If the input value is neither true nor false (not a valid expression of a boolean), an error will be displayed on the client side, and even if you try to execute it, it will not be accepted. Expected input:
true
false
TRUE
'False'
-
-
Field Summary
Fields Modifier and Type Field Description private final ArgumentType<?>
type
private final String
name
private final SuggestionAction<T>
suggestion
private final ContextAction<T>
action
-
Constructor Summary
Constructors Constructor Description BooleanArgument(String name, SuggestionAction<T> suggestion, ContextAction<T> action)
-
Method Summary
Modifier and Type Method Description ArgumentType<?>
getType()
Mojang Brigadier argument type. String
getName()
SuggestionAction<T>
getSuggestion()
ContextAction<T>
getAction()
Argument context action Boolean
parse(CommandContext<CommandListenerWrapper> context, String key)
-
-
Constructor Detail
-
BooleanArgument
BooleanArgument(String name, SuggestionAction<T> suggestion, ContextAction<T> action)
- Parameters:
name
- Name of argument.suggestion
- Lambda expression for tab completion of its arguments.
-
-
Method Detail
-
getType
ArgumentType<?> getType()
Mojang Brigadier argument type.
-
getSuggestion
SuggestionAction<T> getSuggestion()
-
getAction
ContextAction<T> getAction()
Argument context action
-
-
-
-