Interface PromptProvider

All Known Implementing Classes:
ConsolePrompt, StdIOPrompt, StreamPrompt

public interface PromptProvider
A provider of prompting
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the writer to which prompts should be written
    int
    Reads a single key from the prompts source
    Reads a line from the prompts source
    char[]
    Reads a line from the prompts source in a secure manner
    boolean
    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