|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectConfiguration
public class Configuration
Contains information about the test environment, like available factories and disabled tests.
Configuration is used in two places:
ImplementationDetails can provide configuration
information. For example an implementation can declare that it does not support the
calculation of transform derivative.TestListener can obtain the actual configuration
used by the test. For example listeners can know which factories
were used.get, put and remove methods
similar to those of the java.util.Map interface, with the addition of type-safety.
The pre-defined keys are listed below:
TestCase.configuration(),
ImplementationDetails.configuration(Factory[]),
Serialized Form| Nested Class Summary | |
|---|---|
static class |
Configuration.Key<T>
Type-safe keys that can be used in a Configuration map. |
| Constructor Summary | |
|---|---|
Configuration()
Creates a new, initially empty, configuration map. |
|
Configuration(Configuration toCopy)
Creates a new configuration with the same mappings as the specified configuration. |
|
| Method Summary | ||
|---|---|---|
boolean |
equals(Object other)
Compares this configuration with the given object for equality. |
|
|
get(Configuration.Key<T> key)
Returns the value to which the specified key is mapped, or null
if this map contains no mapping for the key. |
|
int |
hashCode()
Returns a hash code value for this configuration map. |
|
Map<Configuration.Key<?>,Object> |
map()
Returns all entries as an unmodifiable map. |
|
|
put(Configuration.Key<T> key,
T value)
Associates the specified value with the specified key in this map. |
|
|
remove(Configuration.Key<T> key)
Removes the mapping for a key from this map if it is present. |
|
String |
toString()
Returns a string representation of this configuration map. |
|
void |
unsupported(Configuration.Key<Boolean>... operations)
Declares that all given operations are unsupported. |
|
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Configuration()
public Configuration(Configuration toCopy)
toCopy - the configuration whose mappings are to be placed in this map.
NullPointerException - if the specified configuration is null.| Method Detail |
|---|
public <T> T get(Configuration.Key<T> key)
null
if this map contains no mapping for the key.
T - The value type, which is determined by the key.key - The key whose associated value is to be returned.
null
if this map contains no mapping for the key.
NullPointerException - if the specified key is null.public <T> T remove(Configuration.Key<T> key)
T - The value type, which is determined by the key.key - The key whose associated value is to be removed.
null.
NullPointerException - if the specified key is null.
public <T> T put(Configuration.Key<T> key,
T value)
T - The value type, which is determined by the key.key - The key with which the specified value is to be associated.value - The value to be associated with the specified key (can be null).
key, or null if there was
no mapping for that key.
NullPointerException - if the specified key is null.public void unsupported(Configuration.Key<Boolean>... operations)
put(key, Boolean.False) for
all operations given in argument.
operations - The operations to declare as unsupported.
NullPointerException - if a specified key is null.public Map<Configuration.Key<?>,Object> map()
Configuration object.public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectother - The other object to compare with this configuration.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||