Package picocli
Class CommandLine.Model.UnmatchedArgsBinding
- java.lang.Object
-
- picocli.CommandLine.Model.UnmatchedArgsBinding
-
- Enclosing class:
- CommandLine.Model
public static class CommandLine.Model.UnmatchedArgsBinding extends java.lang.Object
This class allows applications to specify a custom binding that will be invoked for unmatched arguments. A binding can be created with aISetter
that consumes the unmatched argumentsString[]
, or with aIGetter
that produces aCollection<String>
that the unmatched arguments can be added to.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private CommandLine.Model.IGetter
getter
private java.lang.Object
initialValue
private CommandLine.Model.ISetter
setter
-
Constructor Summary
Constructors Modifier Constructor Description private
UnmatchedArgsBinding(CommandLine.Model.IGetter getter, CommandLine.Model.ISetter setter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addAll(java.lang.String[] unmatched)
(package private) void
clear()
static CommandLine.Model.UnmatchedArgsBinding
forStringArrayConsumer(CommandLine.Model.ISetter setter)
Creates aUnmatchedArgsBinding
for a setter that consumesString[]
objects.static CommandLine.Model.UnmatchedArgsBinding
forStringCollectionSupplier(CommandLine.Model.IGetter getter)
Creates aUnmatchedArgsBinding
for a getter that produces aCollection<String>
that the unmatched arguments can be added to.CommandLine.Model.IGetter
getter()
Returns the getter responsible for producing aCollection
that the unmatched arguments can be added to.CommandLine.Model.ISetter
setter()
Returns the setter responsible for consuming the unmatched arguments.
-
-
-
Field Detail
-
getter
private final CommandLine.Model.IGetter getter
-
setter
private final CommandLine.Model.ISetter setter
-
initialValue
private java.lang.Object initialValue
-
-
Constructor Detail
-
UnmatchedArgsBinding
private UnmatchedArgsBinding(CommandLine.Model.IGetter getter, CommandLine.Model.ISetter setter)
-
-
Method Detail
-
forStringArrayConsumer
public static CommandLine.Model.UnmatchedArgsBinding forStringArrayConsumer(CommandLine.Model.ISetter setter)
Creates aUnmatchedArgsBinding
for a setter that consumesString[]
objects.- Parameters:
setter
- consumes the String[] array with unmatched arguments.
-
forStringCollectionSupplier
public static CommandLine.Model.UnmatchedArgsBinding forStringCollectionSupplier(CommandLine.Model.IGetter getter)
Creates aUnmatchedArgsBinding
for a getter that produces aCollection<String>
that the unmatched arguments can be added to.- Parameters:
getter
- supplies aCollection<String>
that the unmatched arguments can be added to.
-
getter
public CommandLine.Model.IGetter getter()
Returns the getter responsible for producing aCollection
that the unmatched arguments can be added to.
-
setter
public CommandLine.Model.ISetter setter()
Returns the setter responsible for consuming the unmatched arguments.
-
addAll
void addAll(java.lang.String[] unmatched)
-
clear
void clear()
-
-