Object
Configuration
- All Implemented Interfaces:
Serializable
Contains information about the test environment, like available factories and disabled tests.
Configuration
is used:
- Before each test is executed. For example, an implementation can declare that it does not support the calculation of transform derivative.
- After each test is executed, for obtaining the actual configuration used by the test.
get
, put
and remove
methods
similar to those of the java.util.Map
interface, with the addition of type-safety.
The predefined keys are listed below:
- Since:
- 3.1
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Type-safe keys that can be used in aConfiguration
map. -
Constructor Summary
ConstructorDescriptionCreates a new, initially empty, configuration map.Configuration
(Configuration toCopy) Creates a new configuration with the same mappings as the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this configuration with the given object for equality.<T> T
get
(Configuration.Key<T> key) Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key.int
hashCode()
Returns a hash code value for this configuration map.map()
Returns all entries as an unmodifiable map.<T> T
put
(Configuration.Key<T> key, T value) Associates the specified value with the specified key in this map.<T> T
remove
(Configuration.Key<T> key) Removes the mapping for a key from this map if it is present.toString()
Returns a string representation of this configuration map.final void
unsupported
(Configuration.Key<Boolean>... operations) Declares that all given operations are unsupported.
-
Constructor Details
-
Configuration
public Configuration()Creates a new, initially empty, configuration map. -
Configuration
Creates a new configuration with the same mappings as the specified configuration.- Parameters:
toCopy
- the configuration whose mappings are to be placed in this map.- Throws:
NullPointerException
- if the specified configuration is null.
-
-
Method Details
-
get
Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key.- Type Parameters:
T
- the value type, which is determined by the key.- Parameters:
key
- the key whose associated value is to be returned.- Returns:
- the value to which the specified key is mapped, or
null
if this map contains no mapping for the key. - Throws:
NullPointerException
- if the specified key is null.
-
remove
Removes the mapping for a key from this map if it is present.- Type Parameters:
T
- the value type, which is determined by the key.- Parameters:
key
- the key whose associated value is to be removed.- Returns:
- the value which was previously mapped to the specified key, or
null
. - Throws:
NullPointerException
- if the specified key is null.
-
put
Associates the specified value with the specified key in this map.- Type Parameters:
T
- the value type, which is determined by the key.- Parameters:
key
- the key with which the specified value is to be associated.value
- the value to be associated with the specified key (can benull
).- Returns:
- the previous value associated with
key
, ornull
if there was no mapping for that key. - Throws:
NullPointerException
- if the specified key is null.
-
unsupported
Declares that all given operations are unsupported. This is a convenience method invokingput(key, Boolean.False)
for all operations given in argument.- Parameters:
operations
- the operations to declare as unsupported.- Throws:
NullPointerException
- if a specified key is null.
-
map
Returns all entries as an unmodifiable map.- Returns:
- a map view over the entries in this
Configuration
object.
-
hashCode
-
equals
-
toString
-