Class ParameterArray<S extends Source,E>
java.lang.Object
studio.mevera.imperat.util.TypeCapturer
studio.mevera.imperat.command.parameters.type.BaseParameterType<S,E[]>
studio.mevera.imperat.command.parameters.type.ParameterArray<S,E>
- All Implemented Interfaces:
ParameterType<S,E[]>
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.parameters.type.BaseParameterType
suggestions, type -
Constructor Summary
ConstructorsConstructorDescriptionParameterArray(TypeWrap<E[]> type, Function<Integer, Object[]> initializer, ParameterType<S, E> componentType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisGreedy(CommandParameter<S> parameter) Determines if this parameter type is greedy, meaning it consumes multiple arguments.E @Nullable []resolve(@NotNull ExecutionContext<S> context, @NotNull CommandInputStream<S> stream, @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
-
ParameterArray
-
-
Method Details
-
resolve
public E @Nullable [] resolve(@NotNull @NotNull ExecutionContext<S> context, @NotNull @NotNull CommandInputStream<S> stream, @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.stream- 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.
-