Interface CommandLine.Model.IGetter

All Known Subinterfaces:
CommandLine.Model.IScope
Enclosing class:
CommandLine.Model

public static interface CommandLine.Model.IGetter
Customizable getter for obtaining the current value of an option or positional parameter. When an option or positional parameter is matched on the command line, its getter or setter 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

    Modifier and Type
    Method
    Description
    <T> T
    get()
    Returns the current value of the binding.
  • Method Details

    • get

      <T> T get() throws Exception
      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
      Exception - internally, picocli call sites will catch any exceptions thrown from here and rethrow them wrapped in a PicocliException