Class PrimaryKeyFilter.PkTableMap

java.lang.Object
org.dbunit.database.PrimaryKeyFilter.PkTableMap
Enclosing class:
PrimaryKeyFilter

public static class PrimaryKeyFilter.PkTableMap extends Object
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

    Constructors
    Constructor
    Description
    Default constructor.
    Copy constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String tableName, Object pkObject)
    Adds a single allowed primary key for the given table.
    void
    addAll(String tableName, Set pkObjectsToAdd)
    Adds the given allowed primary keys for the given table.
    boolean
    contains(String table, Object pkObject)
    Returns whether the given primary key is allowed for the given table.
    get(String tableName)
    Returns the primary keys allowed for the given table.
    Returns the table names in this map.
    boolean
    Returns whether this map has no tables.
    void
    put(String table, SortedSet pkObjects)
    Associates the given table with the given primary keys, replacing any existing association.
    void
    remove(String tableName)
    Removes the given table and its associated primary keys from this map.
    void
    retainOnly(List tableNames)
    Removes every table not in the given list, and every table whose allowed primary keys are empty.
    int
    Returns the number of tables in this map.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PkTableMap

      public PkTableMap()
      Default constructor.
    • PkTableMap

      public PkTableMap(PrimaryKeyFilter.PkTableMap allowedPKs)
      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:
      true if this map has no tables.
    • contains

      public boolean contains(String table, Object pkObject)
      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:
      true if the given primary key is allowed for the given table.
    • remove

      public void remove(String tableName)
      Removes the given table and its associated primary keys from this map.
      Parameters:
      tableName - the table name to remove.
    • put

      public void put(String table, SortedSet pkObjects)
      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

      public void add(String tableName, Object pkObject)
      Adds a single allowed primary key for the given table.
      Parameters:
      tableName - the table name.
      pkObject - the primary key value to add.
    • addAll

      public void addAll(String tableName, Set pkObjectsToAdd)
      Adds the given allowed primary keys for the given table.
      Parameters:
      tableName - the table name.
      pkObjectsToAdd - the primary key values to add.
    • get

      public SortedSet get(String tableName)
      Returns the primary keys allowed for the given table.
      Parameters:
      tableName - the table name.
      Returns:
      the primary keys allowed for the given table, or null if the table is not present.
    • getTableNames

      public String[] getTableNames()
      Returns the table names in this map.
      Returns:
      the table names in this map.
    • retainOnly

      public void retainOnly(List tableNames)
      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

      public String toString()
      Overrides:
      toString in class Object