Skip to content

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

Class GroupMatch

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

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


public static class GroupMatch

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.

Method Summary

Modifier and Type Method Description
public boolean isEmpty() Returns true if this match has no matched arguments and no matched subgroups.
public ArgGroupSpec group() Returns the ArgGroupSpec of the container GroupMatchContainer of this match.
public GroupMatchContainer container() Returns the container GroupMatchContainer of this match.
public Map<ArgGroupSpec, GroupMatchContainer> matchedSubgroups() Returns matches for the subgroups, if any.
public List<Object> matchedValues(ArgSpec argSpec) Returns the values matched for the specified argument, converted to the type of the argument.
public String toString()

Method Details

isEmpty

public boolean isEmpty()

Returns true if this match has no matched arguments and no matched subgroups.


group

public ArgGroupSpec group()

Returns the ArgGroupSpec of the container GroupMatchContainer of this match.


container

public GroupMatchContainer container()

Returns the container GroupMatchContainer of this match.


matchedSubgroups

public Map<ArgGroupSpec, GroupMatchContainer> matchedSubgroups()

Returns matches for the subgroups, if any.


matchedValues

public List<Object> matchedValues(ArgSpec argSpec)

Returns the values matched for the specified argument, converted to the type of the argument.


toString

public String toString()

Overrides:

Object