Constructor and Description |
---|
ConsoleUserInput() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
prompt(java.lang.String prompt,
java.lang.String defaultValue,
boolean echo)
Display a prompt text to the user and expect them to enter a free-form value.
|
java.lang.String |
promptWithOptions(java.lang.String prompt,
java.lang.String defaultValue,
java.lang.String... options)
Loops until one of the
options is provided. |
public java.lang.String promptWithOptions(java.lang.String prompt, java.lang.String defaultValue, java.lang.String... options)
options
is provided. Pressing return is equivalent to returning
defaultValue
.promptWithOptions
in interface UserInput
prompt
- the a message to prompt the user withdefaultValue
- the default value to be returned if the user simply presses Enteroptions
- valid input option setpublic java.lang.String prompt(java.lang.String prompt, java.lang.String defaultValue, boolean echo)
UserInput