Package org.dbunit.dataset
Class SortedTable.RowComparator
java.lang.Object
org.dbunit.dataset.SortedTable.AbstractRowComparator
org.dbunit.dataset.SortedTable.RowComparator
- All Implemented Interfaces:
Comparator
- Enclosing class:
SortedTable
Compares the rows with each other in order to sort them in the correct
order using the data type and the Comparable implementation the current
column has.
-
Constructor Summary
ConstructorsConstructorDescriptionRowComparator(ITable table, Column[] sortColumns) Constructs a comparator sorting rows of the given table by the given columns, using each column's Comparable implementation. -
Method Summary
Methods inherited from class org.dbunit.dataset.SortedTable.AbstractRowComparator
compareMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
RowComparator
Constructs a comparator sorting rows of the given table by the given columns, using each column's Comparable implementation.- Parameters:
table- the wrapped table to be sorted.sortColumns- the columns to be used for sorting in the given order.
-
-
Method Details
-
compare
Description copied from class:SortedTable.AbstractRowComparatorCompares the two given values of the given column.- Specified by:
comparein classSortedTable.AbstractRowComparator- Parameters:
column- The column to be comparedvalue1- The first value of the given columnvalue2- The second value of the given column- Returns:
- 0 if both values are considered equal.
- Throws:
TypeCastException- if a value cannot be cast for comparison.
-