Interface Console

All Known Implementing Classes:
SystemConsole

public interface Console
Abstraction over interactive console input.

Introduced so the interactive flows (InteractiveCLI, FileOrganizer, RulesFileCreator) no longer depend on a process-wide static Scanner. The production implementation is SystemConsole; tests can supply a fake that scripts answers, making the interactive paths unit-testable.

  • Method Summary

    Modifier and Type
    Method
    Description
    readInput(String prompt)
    Prints prompt then returns the trimmed line read from input.
    readInput(String prompt, String defaultValue)
    Prints prompt (annotated with defaultValue) then returns the trimmed line, substituting defaultValue when the user enters nothing.
    void
    Blocks until the user presses Enter.
  • Method Details

    • readInput

      String readInput(String prompt)
      Prints prompt then returns the trimmed line read from input.
    • readInput

      String readInput(String prompt, String defaultValue)
      Prints prompt (annotated with defaultValue) then returns the trimmed line, substituting defaultValue when the user enters nothing.
    • waitForEnter

      void waitForEnter()
      Blocks until the user presses Enter.