Package org.dbunit.database.rowcount
Class RowCountSnapshot
java.lang.Object
org.dbunit.database.rowcount.RowCountSnapshot
Immutable snapshot of table row counts, keyed by table name, taken at one point in
a
RowCountCheck. Holds no connection and issues no SQL of its own; it is built
from the map a RowCounter already returned.- Since:
- 3.6.0
- Author:
- dbunit
-
Constructor Summary
ConstructorsConstructorDescriptionRowCountSnapshot(Map<String, Integer> rowCounts) Creates a snapshot from aRowCounter's result. -
Method Summary
Modifier and TypeMethodDescriptiondifference(RowCountSnapshot current) Compares this snapshot, used as the baseline, against a snapshot captured later.booleanReturns the row count of each table in this snapshot.inthashCode()toString()
-
Constructor Details
-
RowCountSnapshot
Creates a snapshot from aRowCounter's result.- Parameters:
rowCounts- The row count of each table, keyed by table name; copied, not retained.
-
-
Method Details
-
getRowCounts
Returns the row count of each table in this snapshot.- Returns:
- An unmodifiable map of row count keyed by table name.
-
difference
Compares this snapshot, used as the baseline, against a snapshot captured later. Does not assume the two snapshots share the identical key set: a table absent from one side - e.g. dropped or created between the two captures, or the two connections behind them not enumerating identically - counts as0on that side rather than throwing, so the difference is reported like any other rather than failing with aNullPointerException.- Parameters:
current- The snapshot to compare this baseline against.- Returns:
- One
RowCountDifferenceper table whose count changed, in this snapshot's table order followed by any tablecurrenthas that this snapshot does not, incurrent's order; empty when every count is unchanged.
-
equals
-
hashCode
public int hashCode() -
toString
-