com.fatwire.agent
Class Properties

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>
          extended by com.fatwire.agent.Properties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.util.List<java.lang.String>>
Direct Known Subclasses:
ProviderInfo, RepositoryInfo

public class Properties
extends java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>

Properties class.

This class is used to hold properties of runtime components, e.g. connector, provider, etc. Properties are an associative collection of name-value pairs. A single name can have several corresponding values.

See Also:
Serialized Form

Constructor Summary
Properties()
           
 
Method Summary
 java.lang.String getPropertyValue(java.lang.String name)
          Retrieves property value by its name.
 java.lang.String getPropertyValue(java.lang.String name, java.lang.String defaultValue)
          Retrieves property value by its name.
 java.util.List<java.lang.String> getPropertyValues(java.lang.String name)
          Retrieves property values by the name.
 void setPropertyValue(java.lang.String name, java.lang.String value)
          Sets property value.
 void setPropertyValues(java.lang.String name, java.util.List<java.lang.String> values)
          Sets property values.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

Properties

public Properties()
Method Detail

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
                                  throws NotFoundException
Retrieves property value by its name.

If property has numerous values the first value is returned. An absence of values treated as an empty value and a NULL reference is returned.

Parameters:
key - key to search for.
Throws:
NotFoundException - if the requested value is not present.

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name,
                                         java.lang.String defaultValue)
Retrieves property value by its name. If the supplied key was not found defaultValue is returned. If propery has numerous values the first value is returned.

Parameters:
key - key to search for.
defaultValue - value to return in case key is absent. An absence of values treated as an empty value.

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.String value)
Sets property value.

If the corresponding entry has one or more values they are cleared.

Parameters:
key - property key.
value - property value.

getPropertyValues

public java.util.List<java.lang.String> getPropertyValues(java.lang.String name)
                                                   throws NotFoundException
Retrieves property values by the name. If the entry has one single entry one-element vector is returned. If the entry has no values (default value), empty vector is returned.

Parameters:
key - key to search for.
Throws:
NotFoundException - if the supplied key was not found.

setPropertyValues

public void setPropertyValues(java.lang.String name,
                              java.util.List<java.lang.String> values)
Sets property values. If the corresponding entry has one or more values they are cleared.

Parameters:
key - property key.
values - property values.