Interface PromptProvider
- All Known Implementing Classes:
ConsolePrompt
,StdIOPrompt
,StreamPrompt
public interface PromptProvider
A provider of prompting
-
Method Summary
Modifier and TypeMethodDescriptionGets the writer to which prompts should be writtenint
readKey()
Reads a single key from the prompts sourcereadLine()
Reads a line from the prompts sourcechar[]
Reads a line from the prompts source in a secure mannerboolean
Whether the provider supports secured reads
-
Method Details
-
getPromptWriter
PrintWriter getPromptWriter()Gets the writer to which prompts should be written- Returns:
- Prompt writer
-
readLine
String readLine()Reads a line from the prompts source- Returns:
- Line (or
null
if unable to read a line)
-
readKey
int readKey()Reads a single key from the prompts source- Returns:
- Key code (or -1 if unable to read a key)
-
readSecureLine
char[] readSecureLine()Reads a line from the prompts source in a secure manner- Returns:
- Line (or
null
if unable to read a line)
-
supportsSecureReads
boolean supportsSecureReads()Whether the provider supports secured reads- Returns:
- True if supported, false otherwise
-