org.unitils.dbunit.dataset
Class Row

java.lang.Object
  extended by org.unitils.dbunit.dataset.Row

public class Row
extends Object

A data set row

Author:
Tim Ducheyne, Filip Neven

Constructor Summary
Row()
           
 
Method Summary
 void addColumn(Column column)
          Adds a column to the row.
 void addPrimaryKeyColumn(Column primaryKeyColumn)
          Adds a column to the row.
 RowDifference compare(Row actualRow)
          Compares the row with the given actual row.
protected  void compareColumns(List<Column> columns, Row actualRow, RowDifference result)
          Compares the given columns with the columns of the actual row.
 Column getColumn(String columnName)
          Gets the column for the given name.
 List<Column> getColumns()
           
 List<Column> getPrimaryKeyColumns()
           
 boolean hasDifferentPrimaryKeyColumns(Row actualRow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Row

public Row()
Method Detail

getColumn

public Column getColumn(String columnName)
Gets the column for the given name. The name is case insensitive.

Parameters:
columnName - The name of the column, not null
Returns:
The column, null if not found

getPrimaryKeyColumns

public List<Column> getPrimaryKeyColumns()
Returns:
The primary key columns, empty if none defined

getColumns

public List<Column> getColumns()
Returns:
The columns of the row, not null

addPrimaryKeyColumn

public void addPrimaryKeyColumn(Column primaryKeyColumn)
Adds a column to the row. A column can only be added once.

Parameters:
primaryKeyColumn - The column to add, not null
Throws:
UnitilsException - When a value for the same column was already added

addColumn

public void addColumn(Column column)
Adds a column to the row. A column can only be added once.

Parameters:
column - The column to add, not null
Throws:
UnitilsException - When a value for the same column was already added

hasDifferentPrimaryKeyColumns

public boolean hasDifferentPrimaryKeyColumns(Row actualRow)
Parameters:
actualRow - The row to compare with, not null
Returns:
True if the pk columns did not match

compare

public RowDifference compare(Row actualRow)
Compares the row with the given actual row.

Parameters:
actualRow - The row to compare with, not null
Returns:
The difference, null if none found

compareColumns

protected void compareColumns(List<Column> columns,
                              Row actualRow,
                              RowDifference result)
Compares the given columns with the columns of the actual row.

Parameters:
columns - The columns to compare, not null
actualRow - The columns to compare with, not null
result - The result to add the differences to, not null


Copyright © 2011. All Rights Reserved.