tigase.util.ui.console

## Class CommandlineParameter.Builder

- java.lang.Object
- - tigase.util.ui.console.CommandlineParameter.Builder

- Enclosing class:
    CommandlineParameter

      public static class CommandlineParameter.Builder
      extends Object

  Creates a `CommandlineParameter` builder

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder(String singleLetter, String fullName)` Constructs a `CommandlineParameter` builder.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CommandlineParameter` | `build()` Creates a concrete `CommandlineParameter` from particular builder
    `CommandlineParameter.Builder` | `defaultValue(String defaultValue)` Sets default value for the parameter option
    `CommandlineParameter.Builder` | `description(String description)` Sets the description for the parameter option
    `CommandlineParameter.Builder` | `options(String... options)` Sets possible options for the parameter option
    `CommandlineParameter.Builder` | `requireArguments(boolean required)` Sets whether particular parameter option requires arguments
    `CommandlineParameter.Builder` | `required(boolean required)` Sets whether particular parameter option is required - if yes then it's mandatory to set it's value or provide default.
    `CommandlineParameter.Builder` | `secret()` Sets the parameter option as secret which influences how it will be obtained in interactive mode (won't be printed, useful for passwords)
    `CommandlineParameter.Builder` | `type(Class type)`
    `CommandlineParameter.Builder` | `valueDependentParametersProvider(Function<String,List<CommandlineParameter>> provider)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder(String singleLetter,
                         String fullName)

      Constructs a `CommandlineParameter` builder. It takes as parameters both "single-letter" and "full-name" of which one is mandatory
      Parameters:
        `singleLetter` - single letter identification of the option
        `fullName` - full named identification of the option

  - ### Method Detail

    - #### build

          public CommandlineParameter build()

      Creates a concrete `CommandlineParameter` from particular builder
      Returns:
        constructed `CommandlineParameter`

    - #### defaultValue

          public CommandlineParameter.Builder defaultValue(String defaultValue)

      Sets default value for the parameter option
      Parameters:
        `defaultValue` - default value to be set
      Returns:
        current Builder object

    - #### description

          public CommandlineParameter.Builder description(String description)

      Sets the description for the parameter option
      Parameters:
        `description` - description to be set
      Returns:
        current Builder object

    - #### options

          public CommandlineParameter.Builder options(String... options)

      Sets possible options for the parameter option
      Parameters:
        `options` - array of possible options
      Returns:
        current Builder object

    - #### requireArguments

          public CommandlineParameter.Builder requireArguments(boolean required)

      Sets whether particular parameter option requires arguments
      Parameters:
        `required` - whether the option needs parameter
      Returns:
        current Builder object

    - #### required

          public CommandlineParameter.Builder required(boolean required)

      Sets whether particular parameter option is required - if yes then it's mandatory to set it's value or provide default.
      Parameters:
        `required` - whether the option is required
      Returns:
        current Builder object

    - #### secret

          public CommandlineParameter.Builder secret()

      Sets the parameter option as secret which influences how it will be obtained in interactive mode (won't be printed, useful for passwords)
      Returns:
        current Builder object

    - #### type

          public CommandlineParameter.Builder type(Class type)

    - #### valueDependentParametersProvider

          public CommandlineParameter.Builder valueDependentParametersProvider(Function<String,List<CommandlineParameter>> provider)

Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.