Class RowCountDifference

java.lang.Object
org.dbunit.database.rowcount.RowCountDifference

public class RowCountDifference extends Object
Immutable record of one table's row count having changed between a RowCountCheck baseline and a later comparison.
Since:
3.6.0
Author:
dbunit
  • Constructor Summary

    Constructors
    Constructor
    Description
    RowCountDifference(String tableName, int baselineCount, int currentCount)
    Creates a difference for the given table.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    int
    Returns the row count captured before the test.
    int
    Returns the row count found at comparison time.
    int
    Returns how much the row count changed.
    Returns the name of the table whose count changed.
    int
    Returns a one-line, human-readable description of this difference, naming the table, both counts, the signed delta, and direction-specific advice; the table name prints in the form IDataSet.getTableNames() returned it, so it can be pasted straight into a dataset or an exclude list.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RowCountDifference

      public RowCountDifference(String tableName, int baselineCount, int currentCount)
      Creates a difference for the given table.
      Parameters:
      tableName - The name of the table whose count changed, in the form IDataSet.getTableNames() returned it.
      baselineCount - The row count captured before the test.
      currentCount - The row count found at comparison time.
  • Method Details

    • getTableName

      public String getTableName()
      Returns the name of the table whose count changed.
      Returns:
      The table name, in the form IDataSet.getTableNames() returned it.
    • getBaselineCount

      public int getBaselineCount()
      Returns the row count captured before the test.
      Returns:
      The baseline row count.
    • getCurrentCount

      public int getCurrentCount()
      Returns the row count found at comparison time.
      Returns:
      The current row count.
    • getDelta

      public int getDelta()
      Returns how much the row count changed.
      Returns:
      getCurrentCount() minus getBaselineCount(); positive when rows were left behind, negative when rows that should remain were removed.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a one-line, human-readable description of this difference, naming the table, both counts, the signed delta, and direction-specific advice; the table name prints in the form IDataSet.getTableNames() returned it, so it can be pasted straight into a dataset or an exclude list.
      Overrides:
      toString in class Object
      Returns:
      The one-line description.