@Component public class ConsoleUserInput extends Object implements UserInput
UserInput that uses Standard in and out.| Constructor and Description |
|---|
ConsoleUserInput() |
| Modifier and Type | Method and Description |
|---|---|
String |
prompt(String prompt,
String defaultValue,
boolean echo)
Display a prompt text to the user and expect them to enter a free-form value.
|
String |
promptWithOptions(String prompt,
String defaultValue,
String... options)
Loops until one of the
options is provided. |
public String promptWithOptions(String prompt, String defaultValue, String... options)
options is provided. Pressing return is equivalent to returning
defaultValue.promptWithOptions in interface UserInputprompt - the a message to prompt the user withdefaultValue - the default value to be returned if the user simply presses Enteroptions - valid input option setCopyright © 2016 Pivotal Software, Inc.. All rights reserved.