Package picocli
Class CommandLine.Model.UnmatchedArgsBinding
java.lang.Object
picocli.CommandLine.Model.UnmatchedArgsBinding
- Enclosing class:
CommandLine.Model
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.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommandLine.Model.IGetterprivate Objectprivate final CommandLine.Model.ISetter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUnmatchedArgsBinding(CommandLine.Model.IGetter getter, CommandLine.Model.ISetter setter) -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidclear()Creates aUnmatchedArgsBindingfor a setter that consumesString[]objects.Creates aUnmatchedArgsBindingfor a getter that produces aCollection<String>that the unmatched arguments can be added to.getter()Returns the getter responsible for producing aCollectionthat the unmatched arguments can be added to.setter()Returns the setter responsible for consuming the unmatched arguments.
-
Field Details
-
getter
-
setter
-
initialValue
-
-
Constructor Details
-
UnmatchedArgsBinding
-
-
Method Details
-
forStringArrayConsumer
public static CommandLine.Model.UnmatchedArgsBinding forStringArrayConsumer(CommandLine.Model.ISetter setter) Creates aUnmatchedArgsBindingfor 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 aUnmatchedArgsBindingfor 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
Returns the getter responsible for producing aCollectionthat the unmatched arguments can be added to. -
setter
Returns the setter responsible for consuming the unmatched arguments. -
addAll
-
clear
void clear()
-