public interface UserInput
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)
Display a prompt text to the user and expect one of
options in return. |
String promptWithOptions(String prompt, String defaultValue, String... options)
options
in return.prompt
- the a message to prompt the user withdefaultValue
- the default value to be returned if the user simply presses
Enteroptions
- valid input option setString prompt(String prompt, String defaultValue, boolean echo)
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)Copyright © 2024 Pivotal Software, Inc.. All rights reserved.