Skip to content

Package io.github.qishr.cascara.common.util

Class GroupMatchContainer

java.lang.Object
        io.github.qishr.cascara.common.util.CommandLine.ParseResult.GroupMatchContainer

Enclosing Class:
    io.github.qishr.cascara.common.util.CommandLine.ParseResult


public static class GroupMatchContainer

Provides information about an ArgGroup that was matched on the command line.

The ParseResult may have more than one GroupMatchContainer for an ArgGroupSpec, when the group was matched more often than its maximum multiplicity. This is not necessarily a problem: the parser will add a match to the parent matched group until the maximum multiplicity of the parent group is exceeded, in which case parser will add a match to the parent's parent group, etc.

Ultimately, as long as the ParseResult#getGroupMatches() method does not return more than one match, the maximum number of elements is not exceeded.

Method Summary

Modifier and Type Method Description
public ArgGroupSpec group() Returns the ArgGroupSpec whose matches are captured in this GroupMatchContainer.
public List<GroupMatch> matches() Returns the list of GroupMatch instances: ArgGroupSpecs with a multiplicity greater than one may be matched multiple times.
public String toString()

Method Details

group

public ArgGroupSpec group()

Returns the ArgGroupSpec whose matches are captured in this GroupMatchContainer.


matches

public List<GroupMatch> matches()

Returns the list of GroupMatch instances: ArgGroupSpecs with a multiplicity greater than one may be matched multiple times.


toString

public String toString()

Overrides:

Object