Class ConsoleUserInput
java.lang.Object
org.springframework.cloud.dataflow.shell.command.ConsoleUserInput
- All Implemented Interfaces:
UserInput
UserInput
that uses Standard in and out.- Author:
- Eric Bottard, Gary Russell, Chris Bono
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDisplay a prompt text to the user and expect them to enter a free-form value.promptWithOptions
(String prompt, String defaultValue, String... options) Loops until one of theoptions
is provided.
-
Constructor Details
-
ConsoleUserInput
public ConsoleUserInput()
-
-
Method Details
-
promptWithOptions
Loops until one of theoptions
is provided. Pressing return is equivalent to returningdefaultValue
.- Specified by:
promptWithOptions
in interfaceUserInput
- Parameters:
prompt
- the a message to prompt the user withdefaultValue
- the default value to be returned if the user simply presses Enteroptions
- valid input option set- Returns:
- the prompt text to display to the user
-
prompt
Description copied from interface:UserInput
Display a prompt text to the user and expect them to enter a free-form value. Optionally, the input is echoed.- Specified by:
prompt
in interfaceUserInput
- Parameters:
prompt
- the a message to prompt the user withdefaultValue
- the default value to be returned if the user simply presses Enterecho
- echo the input to output (set to false for sensitive input, e.g. passwords)- Returns:
- the prompt text to display to the user
-