Class TableFormatter

java.lang.Object
org.dbunit.util.TableFormatter

public class TableFormatter extends Object
Simple formatter to print out ITable objects in a beautiful way, for example on a console.
Since:
2.4.1
Version:
$Revision$ $Date$
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Constructor Details

    • TableFormatter

      public TableFormatter()
  • Method Details

    • padLeft

      public static final String padLeft(String s, int length, char padChar)
      Pads the given String with the given padChar up to the given length.
      Parameters:
      s -
      length -
      padChar -
      Returns:
      The padded string
    • padRight

      public static final String padRight(String s, int length, char padChar)
      Pads the given String with the given padChar up to the given length.
      Parameters:
      s -
      length -
      padChar -
      Returns:
      The padded string
    • format

      public String format(ITable table) throws DataSetException
      Formats a table with all data in a beautiful way. Can be useful to print out the table data on a console.
      Parameters:
      table - The table to be formatted in a beautiful way
      Returns:
      The table data as a formatted String
      Throws:
      DataSetException