Class ParameterCommand<S extends Source>
java.lang.Object
studio.mevera.imperat.util.TypeCapturer
studio.mevera.imperat.command.parameters.type.BaseParameterType<S,Command<S>>
studio.mevera.imperat.command.parameters.type.ParameterCommand<S>
- All Implemented Interfaces:
ParameterType<S,Command<S>>
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.parameters.type.BaseParameterType
suggestions, type -
Method Summary
Modifier and TypeMethodDescriptiongetName()booleanmatchesInput(int rawPosition, Context<S> ctx, CommandParameter<S> parameter) Determines whether the provided input matches the expected format or criteria for a given command parameter.resolve(@NotNull ExecutionContext<S> context, @NotNull CommandInputStream<S> commandInputStream, @NotNull String input) Resolves the parameter value from the given input string, using the provided execution context and input stream.Methods inherited from class studio.mevera.imperat.command.parameters.type.BaseParameterType
getSuggestionResolver, type, withSuggestionsMethods inherited from class studio.mevera.imperat.util.TypeCapturer
extractType, extractTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface studio.mevera.imperat.command.parameters.type.ParameterType
equalsExactly, getConsumedArguments, isGreedy, isRelatedToType, supplyDefaultValue, wrappedType
-
Method Details
-
resolve
@Nullable public @Nullable Command<S> resolve(@NotNull @NotNull ExecutionContext<S> context, @NotNull @NotNull CommandInputStream<S> commandInputStream, @NotNull @NotNull String input) throws ImperatException Description copied from interface:ParameterTypeResolves the parameter value from the given input string, using the provided execution context and input stream.- Parameters:
context- the execution context.commandInputStream- the command input stream.input- the raw input string.- Returns:
- the resolved value, or
nullif resolution fails. - Throws:
ImperatException- if resolution fails due to an error.
-
matchesInput
Description copied from class:BaseParameterTypeDetermines whether the provided input matches the expected format or criteria for a given command parameter. this is used duringCommandTree.contextMatch(Context, ArgumentInput)- Specified by:
matchesInputin interfaceParameterType<S extends Source,Command<S extends Source>> - Overrides:
matchesInputin classBaseParameterType<S extends Source,Command<S extends Source>> - Parameters:
rawPosition- The raw position of the argument in the input.ctx- The context to be matched, providing necessary information about the command execution environment.parameter- The command parameter that provides context for the input handling.- Returns:
- true if the input matches the expected criteria; false otherwise.
-
getName
-