Class AbstractOutputter<E extends AbstractOutputter<E>>

java.lang.Object
org.assertj.db.global.AbstractElement<E>
org.assertj.db.output.AbstractOutputter<E>
Type Parameters:
E - the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
All Implemented Interfaces:
org.assertj.core.api.Descriptable<E>
Direct Known Subclasses:
AbstractDbOutputter, AbstractOutputterWithOrigin

public abstract class AbstractOutputter<E extends AbstractOutputter<E>> extends AbstractElement<E>
Base class for all output of assertj-db.
Since:
1.1.0
Author:
Régis Pouiller
  • Field Details

    • outputType

      protected Output outputType
      Type of output.
  • Method Details

    • withType

      public E withType(Output outputType)
      Changes the type of the output.
      Parameters:
      outputType - Type of output.
      Returns:
      this output object.
    • getOutput

      protected abstract String getOutput(Output outputType)
      Returns the output for the output
      Parameters:
      outputType - Type of output.
      Returns:
      The output.
    • toConsole

      public E toConsole()
      Output this to the System.out.
      Returns:
      this output object.
    • toStream

      public E toStream(OutputStream outputStream)
      Output this to the OutputStream.
      Parameters:
      outputStream - OutputStream to use for output.
      Returns:
      this output object.
    • toFile

      public E toFile(String fileName)
      Output this to a file.
      Parameters:
      fileName - The file name.
      Returns:
      this output object.
      Throws:
      AssertJDBException - If exception in IO.