Class RowFilterTable

java.lang.Object
org.dbunit.dataset.RowFilterTable
All Implemented Interfaces:
IRowValueProvider, ITable

public class RowFilterTable extends Object implements ITable, IRowValueProvider
Filters table rows by using arbitrary column values of the table to check if a row should be filtered or not.
Implemented as a decorator for ITable. See dbunit feature request at #1959771
Since:
2.3.0
Version:
$Revision$ $Date$
Author:
gommma, Last changed by: $Author$
  • Constructor Details

    • RowFilterTable

      public RowFilterTable(ITable table, IRowFilter rowFilter) throws DataSetException
      Creates a new ITable where some rows can be filtered out from the original table
      Parameters:
      table - The table to be wrapped
      rowFilter - The row filter that checks for every row whether or not it should be filtered
      Throws:
      DataSetException - if building the filtered row set fails.
  • Method Details

    • getTableMetaData

      public ITableMetaData getTableMetaData()
      Description copied from interface: ITable
      Returns this table metadata.
      Specified by:
      getTableMetaData in interface ITable
      Returns:
      this table metadata.
    • getRowCount

      public int getRowCount()
      Description copied from interface: ITable
      Returns this table row count.
      Specified by:
      getRowCount in interface ITable
      Returns:
      this table row count.
    • getValue

      public Object getValue(int row, String column) throws DataSetException
      Description copied from interface: ITable
      Returns this table value for the specified row and column.
      Specified by:
      getValue in interface ITable
      Parameters:
      row - The row index, starting with 0
      column - The name of the column
      Returns:
      The value
      Throws:
      DataSetException
    • getColumnValue

      public Object getColumnValue(String columnName) throws DataSetException
      Returns the column value for the column with the given name of the currently processed row
      Specified by:
      getColumnValue in interface IRowValueProvider
      Parameters:
      columnName - The db column name for which the value should be provided (current row's value)
      Returns:
      The value of the given column in the current row
      Throws:
      DataSetException - if the value cannot be retrieved.
      See Also: