org.apache.lucene.gdata.server.registry.configuration
Class ComponentConfiguration

java.lang.Object
  extended by org.apache.lucene.gdata.server.registry.configuration.ComponentConfiguration

public 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 IllegalArgumentException will be thrown.

Author:
Simon Willnauer
See Also:
Map

Constructor Summary
ComponentConfiguration()
          Creates a new ComponentConfiguration object and initializes the internal map.
 
Method Summary
 boolean contains(String key)
           
 String get(String key)
          Returns the value of the key or null if the key is not set.
 void set(String key, String value)
          Stores a key / value pair as a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentConfiguration

public ComponentConfiguration()
Creates a new ComponentConfiguration object and initializes the internal map.

Method Detail

set

public void set(String key,
                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.

Parameters:
key - - the property as a key
value - - the value for the key
See Also:
Map.put(Object, Object)

get

public String get(String key)
Returns the value of the key or null if the key is not set.

Parameters:
key - - the key
Returns:
- the value for the key or null if the key is not set.
See Also:
Map.get(java.lang.Object)

contains

public boolean contains(String key)
Parameters:
key - - a string key
Returns:
- true if the key is set, otherwise false
See Also:
Map.containsKey(java.lang.Object)


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.