Class ParameterCollection<S extends Source,E,C extends Collection<E>>
java.lang.Object
studio.mevera.imperat.util.TypeCapturer
studio.mevera.imperat.command.parameters.type.BaseParameterType<S,C>
studio.mevera.imperat.command.parameters.type.ParameterCollection<S,E,C>
- All Implemented Interfaces:
ParameterType<S,C>
public class ParameterCollection<S extends Source,E,C extends Collection<E>>
extends BaseParameterType<S,C>
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.parameters.type.BaseParameterType
suggestions, type -
Constructor Summary
ConstructorsConstructorDescriptionParameterCollection(TypeWrap<C> type, Supplier<C> collectionSupplier, ParameterType<S, E> componentResolver) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisGreedy(CommandParameter<S> parameter) Determines if this parameter type is greedy, meaning it consumes multiple arguments.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, matchesInput, 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, isRelatedToType, supplyDefaultValue, wrappedType
-
Constructor Details
-
ParameterCollection
-
-
Method Details
-
resolve
@Nullable public C 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.
-
isGreedy
Description copied from interface:ParameterTypeDetermines if this parameter type is greedy, meaning it consumes multiple arguments. By default, returnsfalse.- Parameters:
parameter- the command parameter.- Returns:
trueif greedy,falseotherwise.
-