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) void
addMatchedValue
(CommandLine.Model.ArgSpec argSpec, int matchPosition, Object stronglyTypedValue, CommandLine.Tracer tracer) (package private) void
addOriginalStringValue
(CommandLine.Model.ArgSpec argSpec, String value) Returns the containerGroupMatchContainer
of this match.group()
Returns theArgGroupSpec
of the containerGroupMatchContainer
of this match.private boolean
hasFullyMatchedSubgroup
(boolean allRequired) (package private) boolean
hasMatchedValueAtPosition
(CommandLine.Model.ArgSpec arg, int position) boolean
isEmpty()
Returnstrue
if this match has no matched arguments and no matched subgroups.(package private) int
matchCount
(CommandLine.Model.ArgSpec argSpec) private boolean
matchedFully
(boolean allRequired) (package private) boolean
Returnstrue
if 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) boolean
Returnstrue
if 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 StringBuilder
toString
(StringBuilder result) (package private) void
validate
(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()Returnstrue
if this match has no matched arguments and no matched subgroups. -
group
Returns theArgGroupSpec
of the containerGroupMatchContainer
of this match. -
container
Returns the containerGroupMatchContainer
of 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()Returnstrue
if 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()Returnstrue
if 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
-