org.opengis.test
Class Configuration

Show UML class diagram
Object
  extended by Configuration
All Implemented Interfaces:
Serializable

public class Configuration
extends Object
implements Serializable

Contains information about the test environment, like available factories and disabled tests. Configuration is used in two places:

This class provides 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:
Supported features Factories Other
isMultiLocaleSupported
isMixedNameSyntaxSupported
isStandardNameSupported
isStandardAliasSupported
isDependencyIdentificationSupported
isDoubleToDoubleSupported
isFloatToFloatSupported
isDoubleToFloatSupported
isFloatToDoubleSupported
isOverlappingArraySupported
isInverseTransformSupported
isDerivativeSupported
isNonSquareMatrixSupported
isNonBidimensionalSpaceSupported
isAxisSwappingSupported
mtFactory
copFactory
copAuthorityFactory
crsFactory
crsAuthorityFactory
csFactory
csAuthorityFactory
datumFactory
datumAuthorityFactory
validators
isToleranceRelaxed

Since:
3.1
See Also:
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.
<T> T
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.
<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.
 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

Configuration

public Configuration()
Creates a new, initially empty, configuration map.


Configuration

public Configuration(Configuration toCopy)
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 Detail

get

public <T> T 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.

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

public <T> T remove(Configuration.Key<T> key)
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

public <T> T put(Configuration.Key<T> key,
                 T value)
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 be null).
Returns:
The previous value associated with key, or null if there was no mapping for that key.
Throws:
NullPointerException - if the specified key is null.

unsupported

public void unsupported(Configuration.Key<Boolean>... operations)
Declares that all given operations are unsupported. This is a convenience method invoking put(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

public Map<Configuration.Key<?>,Object> map()
Returns all entries as an unmodifiable map.

Returns:
A map view over the entries in this Configuration object.

hashCode

public int hashCode()
Returns a hash code value for this configuration map.

Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Compares this configuration with the given object for equality.

Overrides:
equals in class Object
Parameters:
other - The other object to compare with this configuration.

toString

public String toString()
Returns a string representation of this configuration map.

Overrides:
toString in class Object


Copyright © 1994-2013 Open Geospatial Consortium. All Rights Reserved.