ComponentConfigurationpublic class ComponentConfiguration extends Object Simple configuration class storing properties as key with defined property
values as values in a Map . As a map cannot
contain duplicate keys the first use of a key can not be replaced. If a key
is used twice a {@link java.lang.IllegalArgumentException} will be thrown. |
Fields Summary |
---|
private final Map | configMap |
Constructors Summary |
---|
public ComponentConfiguration()Creates a new ComponentConfiguration object and initializes the internal
map.
super();
this.configMap = new HashMap<String, String>();
|
Methods Summary |
---|
public boolean | contains(java.lang.String key)
return this.configMap.containsKey(key);
| public java.lang.String | get(java.lang.String key)Returns the value of the key or null if the key is not set.
return this.configMap.get(key);
| public void | set(java.lang.String key, java.lang.String value)Stores a key / value pair as a property. If a key is used twice the first
call will set the key / value pair. Any subsequent calls with a already
set key will throw a IllegalArgumentException.
if (this.configMap.containsKey(key))
throw new IllegalArgumentException("key has already been used");
this.configMap.put(key, value);
|
|