Package org.dbunit.database
Class PrimaryKeyFilter.PkTableMap
java.lang.Object
org.dbunit.database.PrimaryKeyFilter.PkTableMap
- Enclosing class:
PrimaryKeyFilter
Map that associates a table with a set of primary key objects.
- Since:
- 2.3.0
- Version:
- $Revision$ $Date$
- Author:
- gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PkTableMap(PrimaryKeyFilter.PkTableMap allowedPKs) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a single allowed primary key for the given table.voidAdds the given allowed primary keys for the given table.booleanReturns whether the given primary key is allowed for the given table.Returns the primary keys allowed for the given table.String[]Returns the table names in this map.booleanisEmpty()Returns whether this map has no tables.voidAssociates the given table with the given primary keys, replacing any existing association.voidRemoves the given table and its associated primary keys from this map.voidretainOnly(List tableNames) Removes every table not in the given list, and every table whose allowed primary keys are empty.intsize()Returns the number of tables in this map.toString()
-
Constructor Details
-
PkTableMap
public PkTableMap()Default constructor. -
PkTableMap
Copy constructor- Parameters:
allowedPKs- the map to copy.
-
-
Method Details
-
size
public int size()Returns the number of tables in this map.- Returns:
- the number of tables in this map.
-
isEmpty
public boolean isEmpty()Returns whether this map has no tables.- Returns:
trueif this map has no tables.
-
contains
Returns whether the given primary key is allowed for the given table.- Parameters:
table- the table name.pkObject- the primary key value to check.- Returns:
trueif the given primary key is allowed for the given table.
-
remove
Removes the given table and its associated primary keys from this map.- Parameters:
tableName- the table name to remove.
-
put
Associates the given table with the given primary keys, replacing any existing association.- Parameters:
table- the table name.pkObjects- the primary keys to associate with the table.
-
add
Adds a single allowed primary key for the given table.- Parameters:
tableName- the table name.pkObject- the primary key value to add.
-
addAll
Adds the given allowed primary keys for the given table.- Parameters:
tableName- the table name.pkObjectsToAdd- the primary key values to add.
-
get
Returns the primary keys allowed for the given table.- Parameters:
tableName- the table name.- Returns:
- the primary keys allowed for the given table, or
nullif the table is not present.
-
getTableNames
Returns the table names in this map.- Returns:
- the table names in this map.
-
retainOnly
Removes every table not in the given list, and every table whose allowed primary keys are empty.- Parameters:
tableNames- the table names to retain.
-
toString
-