CommandlineParameter.Builder

public static class Builder

Creates a CommandlineParameter builder

Constructors

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

Methods

build

public CommandlineParameter build()

Creates a concrete CommandlineParameter from particular builder

Returns:constructed CommandlineParameter

defaultValue

public Builder defaultValue(String defaultValue)

Sets default value for the parameter option

Parameters:
  • defaultValue – default value to be set
Returns:

current Builder object

description

public Builder description(String description)

Sets the description for the parameter option

Parameters:
  • description – description to be set
Returns:

current Builder object

options

public Builder options(String... options)

Sets possible options for the parameter option

Parameters:
  • options – array of possible options
Returns:

current Builder object

requireArguments

public Builder requireArguments(boolean required)

Sets whether particular parameter option requires arguments

Parameters:
  • required – whether the option needs parameter
Returns:

current Builder object

required

public 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 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 Builder type(Class type)

valueDependentParametersProvider

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