Interface InputReader

All Known Implementing Classes:
ConsoleInputReader, JLineInputReader

public interface InputReader
Interface for reading input from the user.
Since:
4.0.0
Author:
Mahmoud Ben Hassine
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Read a line of input from the user.
    default String
    readInput(String prompt)
    Read a line of input from the user with a prompt.
    default char[]
    Read a password from the user.
    default char[]
    Read a password from the user with a prompt.
  • Method Details

    • readInput

      default String readInput() throws Exception
      Read a line of input from the user.
      Returns:
      the input line
      Throws:
      Exception - if an error occurs while reading input
    • readInput

      default String readInput(String prompt) throws Exception
      Read a line of input from the user with a prompt.
      Parameters:
      prompt - the prompt to display to the user
      Returns:
      the input line
      Throws:
      Exception - if an error occurs while reading input
    • readPassword

      default char[] readPassword() throws Exception
      Read a password from the user.
      Returns:
      the password as a character array
      Throws:
      Exception - if an error occurs while reading the password
    • readPassword

      default char[] readPassword(String prompt) throws Exception
      Read a password from the user with a prompt.
      Parameters:
      prompt - the prompt to display to the user
      Returns:
      the password as a character array
      Throws:
      Exception - if an error occurs while reading the password