Package io.github.qishr.cascara.common.util
Class UnmatchedArgsBinding
java.lang.Object
io.github.qishr.cascara.common.util.CommandLine.Model.UnmatchedArgsBinding
Enclosing Class:
io.github.qishr.cascara.common.util.CommandLine.Model
public static class UnmatchedArgsBinding
This class allows applications to specify a custom binding that will be invoked for unmatched arguments.A binding can be created with a ISetter that consumes the unmatched arguments String[], or with a
IGetter that produces a Collection<String> that the unmatched arguments can be added to.
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public static UnmatchedArgsBinding | forStringArrayConsumer(ISetter setter) | Creates a UnmatchedArgsBinding for a setter that consumes String[] objects. |
| public static UnmatchedArgsBinding | forStringCollectionSupplier(IGetter getter) | Creates a UnmatchedArgsBinding for a getter that produces a Collection<String> that the unmatched arguments can be added to. |
| public IGetter | getter() | Returns the getter responsible for producing a Collection that the unmatched arguments can be added to. |
| public ISetter | setter() | Returns the setter responsible for consuming the unmatched arguments. |
Method Details
forStringArrayConsumer
public static UnmatchedArgsBinding forStringArrayConsumer(ISetter setter)
Creates a UnmatchedArgsBinding for a setter that consumes String[] objects.
Parameters:
setter - consumes the String[] array with unmatched arguments.
forStringCollectionSupplier
public static UnmatchedArgsBinding forStringCollectionSupplier(IGetter getter)
Creates a UnmatchedArgsBinding for a getter that produces a Collection<String> that the unmatched arguments can be added to.
Parameters:
getter - supplies a Collection<String> that the unmatched arguments can be added to.
getter
public IGetter getter()
Returns the getter responsible for producing a Collection that the unmatched arguments can be added to.
setter
public ISetter setter()
Returns the setter responsible for consuming the unmatched arguments.