org.unitils.dbunit.dataset.comparison
Class RowDifference

java.lang.Object
  extended by org.unitils.dbunit.dataset.comparison.RowDifference

public class RowDifference
extends Object

The difference between 2 data set rows.

Author:
Tim Ducheyne, Filip Neven

Constructor Summary
RowDifference(Row row, Row actualRow)
          Create a row difference.
 
Method Summary
 void addColumnDifference(ColumnDifference columnDifference)
          Adds a difference for a column
 void addMissingColumn(Column column)
          Adds a column that was not found in the actual row
 Row getActualRow()
           
 ColumnDifference getColumnDifference(String columnName)
           
 List<ColumnDifference> getColumnDifferences()
           
 List<Column> getMissingColumns()
           
 Row getRow()
           
 boolean isBetterMatch(RowDifference rowComparison)
           
 boolean isMatch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowDifference

public RowDifference(Row row,
                     Row actualRow)
Create a row difference.

Parameters:
row - The expected row, not null
actualRow - The actual row, null if the row was not found
Method Detail

getRow

public Row getRow()
Returns:
The expected row, not null

getActualRow

public Row getActualRow()
Returns:
The actual row, null if the row was not found

getColumnDifferences

public List<ColumnDifference> getColumnDifferences()
Returns:
The differences between the rows, empty if there is a match

getMissingColumns

public List<Column> getMissingColumns()
Returns:
The columns that were not found in the actual row, empty if none found

getColumnDifference

public ColumnDifference getColumnDifference(String columnName)
Parameters:
columnName - The column to find the difference for, not null
Returns:
The differences of that column, null if not found

addColumnDifference

public void addColumnDifference(ColumnDifference columnDifference)
Adds a difference for a column

Parameters:
columnDifference - The difference, not null

addMissingColumn

public void addMissingColumn(Column column)
Adds a column that was not found in the actual row

Parameters:
column - The missing column, not null

isBetterMatch

public boolean isBetterMatch(RowDifference rowComparison)
Parameters:
rowComparison - The result to compare with, not null
Returns:
True if the given result has less differences

isMatch

public boolean isMatch()
Returns:
True if both rows are a match


Copyright © 2011. All Rights Reserved.