Package tigase.util.ui.console
Class CommandlineParameter.Builder
java.lang.Object
tigase.util.ui.console.CommandlineParameter.Builder
- Enclosing class:
- CommandlineParameter
Creates a
CommandlineParameter
builder-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a concreteCommandlineParameter
from particular builderdefaultValue
(String defaultValue) Sets default value for the parameter optiondescription
(String description) Sets the description for the parameter optionSets possible options for the parameter optionrequireArguments
(boolean required) Sets whether particular parameter option requires argumentsrequired
(boolean required) Sets whether particular parameter option is required - if yes then it's mandatory to set it's value or provide default.secret()
Sets the parameter option as secret which influences how it will be obtained in interactive mode (won't be printed, useful for passwords)
-
Constructor Details
-
Builder
Constructs aCommandlineParameter
builder. It takes as parameters both "single-letter" and "full-name" of which one is mandatory- Parameters:
singleLetter
- single letter identification of the optionfullName
- full named identification of the option
-
-
Method Details
-
build
Creates a concreteCommandlineParameter
from particular builder- Returns:
- constructed
CommandlineParameter
-
defaultValue
Sets default value for the parameter option- Parameters:
defaultValue
- default value to be set- Returns:
- current Builder object
-
description
Sets the description for the parameter option- Parameters:
description
- description to be set- Returns:
- current Builder object
-
options
Sets possible options for the parameter option- Parameters:
options
- array of possible options- Returns:
- current Builder object
-
requireArguments
Sets whether particular parameter option requires arguments- Parameters:
required
- whether the option needs parameter- Returns:
- current Builder object
-
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
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
-
valueDependentParametersProvider
public CommandlineParameter.Builder valueDependentParametersProvider(Function<String, List<CommandlineParameter>> provider)
-