Class StringArgument<S extends CommandSource>
java.lang.Object
studio.mevera.imperat.util.TypeCapturer
studio.mevera.imperat.command.arguments.type.ArgumentType<S,String>
studio.mevera.imperat.command.arguments.type.StringArgument<S>
- All Implemented Interfaces:
Prioritizable
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.arguments.type.ArgumentType
suggestions, type -
Method Summary
Modifier and TypeMethodDescriptionintgetNumberOfParametersToConsume(Argument<S> argument) Returns the number of arguments consumed by this parameter type.@NotNull PrioritybooleanDetermines if this parameter type is greedy, meaning it consumes multiple arguments.Parses the argument value from the given input string, using the provided execution context.Methods inherited from class studio.mevera.imperat.command.arguments.type.ArgumentType
addStaticSuggestions, equalsExactly, getDefaultValueProvider, getSuggestionProvider, isRelatedToType, parse, type, wrappedTypeMethods inherited from class studio.mevera.imperat.util.TypeCapturer
extractType, extractType
-
Method Details
-
parse
public String parse(@NotNull @NotNull CommandContext<S> context, @NotNull @NotNull Argument<S> argument, @NotNull @NotNull String input) throws CommandException Description copied from class:ArgumentTypeParses the argument value from the given input string, using the provided execution context. This method is responsible for converting the raw input into the appropriate type, handling any necessary validation or error handling during the parsing process.- Specified by:
parsein classArgumentType<S extends CommandSource,String> - Parameters:
context- the execution context.argument- the argument with this type.input- the raw input string to parse.- Returns:
- the resolved value of type T.
- Throws:
CommandException- if parsing fails.
-
isGreedy
Description copied from class:ArgumentTypeDetermines if this parameter type is greedy, meaning it consumes multiple arguments. By default, returnsfalse.- Overrides:
isGreedyin classArgumentType<S extends CommandSource,String> - Parameters:
parameter- the command parameter.- Returns:
trueif greedy,falseotherwise.
-
getNumberOfParametersToConsume
Description copied from class:ArgumentTypeReturns the number of arguments consumed by this parameter type. By default, returns1.- Overrides:
getNumberOfParametersToConsumein classArgumentType<S extends CommandSource,String> - Returns:
- the number of consumed arguments.
-
getPriority
- Specified by:
getPriorityin interfacePrioritizable- Overrides:
getPriorityin classArgumentType<S extends CommandSource,String>
-