Package net.apartium.cocoabeans.commands
Class SimpleArgumentMapper
java.lang.Object
net.apartium.cocoabeans.commands.SimpleArgumentMapper
- All Implemented Interfaces:
ArgumentMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of mapping arguments to index -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> ArgumentIndex<T>map(ArgumentConverter<T> converter, ArgumentIndex<?> argumentIndex) List<ArgumentIndex<?>>mapIndices(RegisteredVariant.Parameter[] parameters, List<RegisterArgumentParser<?>> argumentParsers, List<Requirement> requirements, Map<Class<?>, List<ArgumentIndex<?>>> providedArgumentIndexesByType) Maps the command arguments into the argument indexes required by the sub command to be call with the right argumentsprotected ArgumentIndex<?>resolveBuiltInArgumentIndex(Class<?> type, Map<Class<?>, Integer> counterMap, Map<Class<?>, List<ArgumentIndex<?>>> mapOfArguments, int index)
-
Field Details
-
PRIMITIVE_TO_WRAPPER_MAP
-
converters
-
-
Constructor Details
-
SimpleArgumentMapper
-
SimpleArgumentMapper
public SimpleArgumentMapper()
-
-
Method Details
-
mapIndices
public List<ArgumentIndex<?>> mapIndices(RegisteredVariant.Parameter[] parameters, List<RegisterArgumentParser<?>> argumentParsers, List<Requirement> requirements, Map<Class<?>, List<ArgumentIndex<?>>> providedArgumentIndexesByType) Description copied from interface:ArgumentMapperMaps the command arguments into the argument indexes required by the sub command to be call with the right arguments- Specified by:
mapIndicesin interfaceArgumentMapper- Parameters:
parameters- parametersargumentParsers- argumentParsers (should be in order)requirements- requirementsprovidedArgumentIndexesByType- provided argument indexes by type- Returns:
- list of argument indexes
-
map
@AvailableSince("0.0.44") protected <T> ArgumentIndex<T> map(ArgumentConverter<T> converter, ArgumentIndex<?> argumentIndex) -
resolveBuiltInArgumentIndex
protected ArgumentIndex<?> resolveBuiltInArgumentIndex(Class<?> type, Map<Class<?>, Integer> counterMap, Map<Class<?>, List<ArgumentIndex<?>>> mapOfArguments, int index)
-