org.unitils.dbunit.dataset
Class Column

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

public class Column
extends Object

A column in a data set row

Author:
Tim Ducheyne, Filip Neven

Constructor Summary
Column(String name, org.dbunit.dataset.datatype.DataType type, Object value)
          Creates a value
 
Method Summary
 ColumnDifference compare(Column actualColumn)
          Compares the column with the given actual column.
 Object getCastedValue(org.dbunit.dataset.datatype.DataType castType)
          Gets the value casted to the given type.
 String getName()
           
 org.dbunit.dataset.datatype.DataType getType()
           
 Object getValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Column

public Column(String name,
              org.dbunit.dataset.datatype.DataType type,
              Object value)
Creates a value

Parameters:
name - The name of the data set column, not null
type - The type of the data set column, e.g. varchar, not null
value - The actual value with a type corresponding the column type, e.g. String for varchar, can be null
Method Detail

getName

public String getName()
Returns:
The name of the data set column, not null

getType

public org.dbunit.dataset.datatype.DataType getType()
Returns:
The type of the data set column, e.g. varchar, not null

getValue

public Object getValue()
Returns:
The actual value with a type corresponding the column type, e.g. String for varchar, can be null

getCastedValue

public Object getCastedValue(org.dbunit.dataset.datatype.DataType castType)
Gets the value casted to the given type.

Parameters:
castType - The type to cast the value to, not null
Returns:
The casted value
Throws:
UnitilsException - When the value cannot be cast

compare

public ColumnDifference compare(Column actualColumn)
Compares the column with the given actual column. If the actual column has a different type, the value will be casted to this type.

Parameters:
actualColumn - The column to compare with, not null
Returns:
The difference, null if none found


Copyright © 2011. All Rights Reserved.