Interface CliPrinter

All Superinterfaces:
Flushable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CliPrinter extends Flushable
Handles text output of the CLI.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Flushes any buffers in the printer.
    static CliPrinter
    Create a new CliPrinter from an OutputStream.
    static CliPrinter
    Create a new CliPrinter from a PrintWriter.
    void
    Prints text to the writer and appends a new line.
  • Method Details

    • println

      void println(String text)
      Prints text to the writer and appends a new line.
      Parameters:
      text - Text to print.
    • flush

      default void flush()
      Flushes any buffers in the printer.
      Specified by:
      flush in interface Flushable
    • fromPrintWriter

      static CliPrinter fromPrintWriter(PrintWriter printWriter)
      Create a new CliPrinter from a PrintWriter.
      Parameters:
      printWriter - PrintWriter to write to.
      Returns:
      Returns the created CliPrinter.
    • fromOutputStream

      static CliPrinter fromOutputStream(OutputStream stream)
      Create a new CliPrinter from an OutputStream.
      Parameters:
      stream - OutputStream to write to.
      Returns:
      Returns the created CliPrinter.