Interface UserInput
- All Known Implementing Classes:
ConsoleUserInput
public interface UserInput
Abstraction for a mechanism used to get user interactive user input.
- Author:
- Eric Bottard, Marius Bogoevici
-
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) Display a prompt text to the user and expect one ofoptionsin return.
-
Method Details
-
promptWithOptions
Display a prompt text to the user and expect one ofoptionsin return.- 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
Display a prompt text to the user and expect them to enter a free-form value. Optionally, the input is echoed.- 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
-