|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbunit.dataset.OrderedTableNameMap
public class OrderedTableNameMap
Associates a table name with an arbitrary object. Moreover the
order of the added table names is maintained and the ordered table
names can be retrieved via getTableNames()
.
The map ensures that one table name can only be added once.
TODO In the future it might be discussed if a ListOrderedMap (apache-commons-collections) can/should be used.
Constructor Summary | |
---|---|
OrderedTableNameMap(boolean caseSensitiveTableNames)
Creates a new map which does strictly force that one table can only occur once. |
Method Summary | |
---|---|
void |
add(String tableName,
Object object)
Adds the given table name to the map of table names, associating it with the given object. |
boolean |
containsTable(String tableName)
Checks if this map contains the given table name |
Object |
get(String tableName)
Returns the object associated with the given table name |
String |
getLastTableName()
|
String |
getTableName(String tableName)
Returns the table name in the correct case (for example as upper case string) |
String[] |
getTableNames()
Provides the ordered table names having the same order in which the table names have been added via add(String, Object) . |
boolean |
isLastTable(String tableName)
|
Collection |
orderedValues()
|
String |
toString()
|
void |
update(String tableName,
Object object)
Updates the value associated with the given table name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OrderedTableNameMap(boolean caseSensitiveTableNames)
caseSensitiveTableNames
- Whether or not table names should be case sensitiveMethod Detail |
---|
public Object get(String tableName)
tableName
- The table name for which the associated object is retrieved
public String[] getTableNames()
add(String, Object)
.
public boolean containsTable(String tableName)
tableName
-
true
if the map of tables contains the given table namepublic boolean isLastTable(String tableName)
tableName
- The table name to check
true
if the given tableName matches the last table that has been added to this map.public String getLastTableName()
null
if no
table has been added yet.public void add(String tableName, Object object) throws AmbiguousTableNameException
tableName
- The table name to be addedobject
- Object to be associated with the given table name. Can be null
AmbiguousTableNameException
- If the given table name already existspublic Collection orderedValues()
public void update(String tableName, Object object)
tableName
- The table name for which the association should be updatedobject
- The new object to be associated with the given table namepublic String getTableName(String tableName)
tableName
- The input table name to be resolved
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |