Package picocli
Class CommandLine.ParseResult.GroupMatch
java.lang.Object
picocli.CommandLine.ParseResult.GroupMatch
- Enclosing class:
CommandLine.ParseResult
A group's multiplicity specifies how many matches of a group may
appear on the command line. This class models a single "match".
For example, this group:
(-a -b) (-a -b) requires two matches of its arguments to fully match.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CommandLine.ParseResult.GroupMatchContainer(package private) Map<CommandLine.Model.ArgGroupSpec, CommandLine.ParseResult.GroupMatchContainer> (package private) Map<CommandLine.Model.ArgSpec, List<Object>> (package private) Map<CommandLine.Model.ArgSpec, List<String>> (package private) int(package private) final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddMatchedValue(CommandLine.Model.ArgSpec argSpec, int matchPosition, Object stronglyTypedValue, CommandLine.Tracer tracer) (package private) voidaddOriginalStringValue(CommandLine.Model.ArgSpec argSpec, String value) Returns the containerGroupMatchContainerof this match.group()Returns theArgGroupSpecof the containerGroupMatchContainerof this match.private booleanhasFullyMatchedSubgroup(boolean allRequired) (package private) booleanhasMatchedValueAtPosition(CommandLine.Model.ArgSpec arg, int position) booleanisEmpty()Returnstrueif this match has no matched arguments and no matched subgroups.(package private) intmatchCount(CommandLine.Model.ArgSpec argSpec) private booleanmatchedFully(boolean allRequired) (package private) booleanReturnstrueif the maximum number of matches has been reached for this match: all arguments (required or not) have been matched, and for each subgroup, the maximum number of elements have been matched.(package private) booleanReturnstrueif the minimum number of elements have been reached for this match: all required arguments have been matched, and for each subgroup, the minimum number of elements have been matched.Returns matches for the subgroups, if any.matchedValues(CommandLine.Model.ArgSpec argSpec) Returns the values matched for the specified argument, converted to the type of the argument.toString()private StringBuildertoString(StringBuilder result) (package private) voidvalidate(CommandLine commandLine)
-
Field Details
-
position
int position -
startPosition
final int startPosition -
container
-
matchedSubgroups
Map<CommandLine.Model.ArgGroupSpec,CommandLine.ParseResult.GroupMatchContainer> matchedSubgroups -
matchedValues
Map<CommandLine.Model.ArgSpec,List<Object>> matchedValues -
originalStringValues
Map<CommandLine.Model.ArgSpec,List<String>> originalStringValues -
matchedValuesAtPosition
-
validationResult
-
-
Constructor Details
-
GroupMatch
GroupMatch(CommandLine.ParseResult.GroupMatchContainer container)
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returnstrueif this match has no matched arguments and no matched subgroups. -
group
Returns theArgGroupSpecof the containerGroupMatchContainerof this match. -
container
Returns the containerGroupMatchContainerof this match. -
matchedSubgroups
public Map<CommandLine.Model.ArgGroupSpec,CommandLine.ParseResult.GroupMatchContainer> matchedSubgroups()Returns matches for the subgroups, if any. -
matchCount
-
matchedValues
Returns the values matched for the specified argument, converted to the type of the argument. -
addOriginalStringValue
-
addMatchedValue
void addMatchedValue(CommandLine.Model.ArgSpec argSpec, int matchPosition, Object stronglyTypedValue, CommandLine.Tracer tracer) -
hasMatchedValueAtPosition
-
matchedMinElements
boolean matchedMinElements()Returnstrueif the minimum number of elements have been reached for this match: all required arguments have been matched, and for each subgroup, the minimum number of elements have been matched. -
matchedMaxElements
boolean matchedMaxElements()Returnstrueif the maximum number of matches has been reached for this match: all arguments (required or not) have been matched, and for each subgroup, the maximum number of elements have been matched. -
matchedFully
private boolean matchedFully(boolean allRequired) -
hasFullyMatchedSubgroup
private boolean hasFullyMatchedSubgroup(boolean allRequired) -
toString
-
toString
-
validate
-