|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dbunit.dataset.Columns
public class Columns
This class exclusively provides static methods that operate on Column objects.
| Nested Class Summary | |
|---|---|
static class |
Columns.ColumnDiff
Describes the Columns that are different in two tables. |
| Method Summary | |
|---|---|
static Column[] |
findColumnsByName(Column[] columns,
ITableMetaData tableMetaData)
Searches for the given columns using only the Column.getColumnName()
in the given tableMetaData |
static Column[] |
findColumnsByName(java.lang.String[] columnNames,
ITableMetaData tableMetaData)
Searches for the given columns using only the Column.getColumnName()
in the given tableMetaData |
static Column |
getColumn(java.lang.String columnName,
Column[] columns)
Search and return the specified column from the specified column array. |
static Columns.ColumnDiff |
getColumnDiff(ITableMetaData expectedMetaData,
ITableMetaData actualMetaData)
Returns the column difference of the two given ITableMetaData objects |
static java.lang.String[] |
getColumnNames(Column[] columns)
Returns the names of the given column objects as string array |
static java.lang.String |
getColumnNamesAsString(Column[] columns)
Creates a pretty string representation of the given column names |
static Column[] |
getColumns(java.lang.String[] columnNames,
Column[] columns)
Search and return the Columns from the specified column array that
match one of the given columnNames. |
static Column[] |
getColumns(java.lang.String tableName,
Column[] columns,
IColumnFilter columnFilter)
Search and return the columns from the specified column array which are accepted by the given IColumnFilter. |
static Column |
getColumnValidated(java.lang.String columnName,
Column[] columns,
java.lang.String tableName)
Search and return the specified column from the specified column array. |
static Column[] |
getSortedColumns(ITableMetaData metaData)
Returns a sorted array of column objects |
static Column[] |
mergeColumnsByName(Column[] referenceColumns,
Column[] columnsToMerge)
Merges the two arrays of columns so that all of the columns are available in the result array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Column[] getColumns(java.lang.String[] columnNames,
Column[] columns)
Columns from the specified column array that
match one of the given columnNames.
findColumnsByName(String[], ITableMetaData)
because it iterates over all columns.
columnNames - the names of the columns to search.columns - the array of columns in which the columnNames will be searched.
findColumnsByName(String[], ITableMetaData)
public static Column[] findColumnsByName(java.lang.String[] columnNames,
ITableMetaData tableMetaData)
throws NoSuchColumnException,
DataSetException
columns using only the Column.getColumnName()
in the given tableMetaData
columnNames - The column names that are searched in the given table metadatatableMetaData - The table metadata in which the columns are searched by name
tableMetaData
NoSuchColumnException - if the given column has not been found
DataSetException - if something goes wrong when trying to retrieve the columns
public static Column[] findColumnsByName(Column[] columns,
ITableMetaData tableMetaData)
throws NoSuchColumnException,
DataSetException
columns using only the Column.getColumnName()
in the given tableMetaData
columns - The columns whose names are searched in the given table metadatatableMetaData - The table metadata in which the columns are searched by name
tableMetaData
NoSuchColumnException - if the given column has not been found
DataSetException - if something goes wrong when trying to retrieve the columns
public static Column getColumn(java.lang.String columnName,
Column[] columns)
ITableMetaData.getColumnIndex(String)
because it iterates over all columns.
columnName - the name of the column to search.columns - the array of columns in which the columnName will be searched.
null if the column is not found
public static Column getColumnValidated(java.lang.String columnName,
Column[] columns,
java.lang.String tableName)
throws NoSuchColumnException
columnName - the name of the column to search.columns - the array of columns in which the columnName will be searched.tableName - The name of the table to which the column array belongs -
only needed for the exception message in case of a validation failure
NoSuchColumnException - If no column exists with the given name
public static Column[] getColumns(java.lang.String tableName,
Column[] columns,
IColumnFilter columnFilter)
IColumnFilter.
tableName - The name of the table which is needed for the filter invocationcolumns - All available columns to which the filter will be appliedcolumnFilter - The column filter that is applied to the given columns
public static Column[] getSortedColumns(ITableMetaData metaData)
throws DataSetException
metaData - The metaData needed to get the columns to be sorted
DataSetExceptionpublic static java.lang.String[] getColumnNames(Column[] columns)
columns - The column objects
public static java.lang.String getColumnNamesAsString(Column[] columns)
columns - The columns to be formatted
public static Column[] mergeColumnsByName(Column[] referenceColumns,
Column[] columnsToMerge)
referenceColumns - reference columns treated as master columns during the mergecolumnsToMerge - potentially new columns to be merged if they do not yet exist in the referenceColumns
public static Columns.ColumnDiff getColumnDiff(ITableMetaData expectedMetaData,
ITableMetaData actualMetaData)
throws DataSetException
ITableMetaData objects
expectedMetaData - actualMetaData -
ITableMetaData objects
DataSetException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||