picocli

## Interface CommandLine.Model.IBinding

Enclosing class:
  CommandLine.Model

    public static interface CommandLine.Model.IBinding

Customizable binding for obtaining and modifying the current value of an option or positional parameter. When an option or positional parameter is matched on the command line, its binding is invoked to capture the value. For example, an option can be bound to a field or a method, and when the option is matched on the command line, the field's value is set or the method is invoked with the option parameter value.

Since:
  3.0

### Method Summary

Methods
`<T> T` `get()` Returns the current value of the binding.
`<T> T` `set(T value)` Sets the new value of the binding.

### Method Detail

#### get

    <T> T get()
          throws CommandLine.PicocliException

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.

Throws:
  `CommandLine.PicocliException` - if a problem occurred while obtaining the current value

#### set

    <T> T set(T value)
          throws CommandLine.PicocliException

Sets the new value of the binding. For multi-value options and positional parameters, this method is used to set a new array instance that is one element larger than the previous instance, or to initialize the collection or map when the `getter` returned `null`. For single-value options and positional parameters, this method simply sets the value.

Type Parameters:
  `T` - type of the value
Parameters:
  `value` - the new value of the binding
Returns:
  the previous value of the binding (if supported by this binding)
Throws:
  `CommandLine.PicocliException` - if a problem occurred while setting the new value