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 TypeMethodDescriptionList<ArgumentIndex<?>> mapIndices(RegisteredVariant.Parameter[] parameters, List<RegisterArgumentParser<?>> argumentParsers, List<Requirement> requirements, List<Class<?>> additionalTypes) 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
-
-
Constructor Details
-
SimpleArgumentMapper
public SimpleArgumentMapper()
-
-
Method Details
-
mapIndices
public List<ArgumentIndex<?>> mapIndices(RegisteredVariant.Parameter[] parameters, List<RegisterArgumentParser<?>> argumentParsers, List<Requirement> requirements, List<Class<?>> additionalTypes) 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- requirementsadditionalTypes- additional types are use for providing additional arguments to the command they are inserted at the end- Returns:
- list of argument indexes
-
resolveBuiltInArgumentIndex
protected ArgumentIndex<?> resolveBuiltInArgumentIndex(Class<?> type, Map<Class<?>, Integer> counterMap, Map<Class<?>, List<ArgumentIndex<?>>> mapOfArguments, int index)
-