Package picocli
Class CommandLine.Model.MethodBinding
java.lang.Object
picocli.CommandLine.Model.MethodBinding
- All Implemented Interfaces:
CommandLine.Model.IGetter
,CommandLine.Model.IScoped
,CommandLine.Model.ISetter
- Enclosing class:
CommandLine.Model
static class CommandLine.Model.MethodBinding
extends Object
implements CommandLine.Model.IGetter, CommandLine.Model.ISetter, CommandLine.Model.IScoped
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
private final Method
private final CommandLine.Model.IScope
private final CommandLine.Model.CommandSpec
-
Constructor Summary
ConstructorsConstructorDescriptionMethodBinding
(CommandLine.Model.IScope scope, Method method, CommandLine.Model.CommandSpec spec) -
Method Summary
Modifier and TypeMethodDescriptionprivate CommandLine.ParameterException
createParameterException
(Object value, Throwable t) <T> T
get()
Returns the current value of the binding.getScope()
Get theCommandLine.Model.IScope
instance.<T> T
set
(T value) Sets the new value of the option or positional parameter.toString()
-
Field Details
-
scope
-
method
-
spec
-
currentValue
-
-
Constructor Details
-
MethodBinding
MethodBinding(CommandLine.Model.IScope scope, Method method, CommandLine.Model.CommandSpec spec)
-
-
Method Details
-
getScope
Description copied from interface:CommandLine.Model.IScoped
Get theCommandLine.Model.IScope
instance.- Specified by:
getScope
in interfaceCommandLine.Model.IScoped
- Returns:
CommandLine.Model.IScope
instance
-
get
public <T> T get()Description copied from interface:CommandLine.Model.IGetter
Returns the current value of the binding. For multi-value options and positional parameters, this method returns an array, collection or map to add values to.- Specified by:
get
in interfaceCommandLine.Model.IGetter
-
set
Description copied from interface:CommandLine.Model.ISetter
Sets the new value of the option or positional parameter.- Specified by:
set
in interfaceCommandLine.Model.ISetter
- Type Parameters:
T
- type of the value- Parameters:
value
- the new value of the option or positional parameter- Returns:
- the previous value of the binding (if supported by this binding)
- Throws:
CommandLine.PicocliException
- if a problem occurred while setting the new value
-
createParameterException
-
toString
-