ghm.follow.config
Class EnumeratedProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byghm.follow.config.EnumeratedProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class EnumeratedProperties
extends java.util.Properties

Extension of Properties which allows one to specify property values which are Lists of Strings.

Author:
Greg Merrill
See Also:
Serialized Form

Field Summary
protected static char delimiter
          Delimiter between property name & list member index
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
EnumeratedProperties()
           
 
Method Summary
 java.util.List getEnumeratedProperty(java.lang.String key)
          Returns the List value of the property with the supplied key.
 void setEnumeratedProperty(java.lang.String key, java.util.List values)
          Convenience method; equivalent to calling setEnumeratedProperty(key, (String[])values.toArray(new String[] {}));
 void setEnumeratedProperty(java.lang.String key, java.lang.String[] values)
          Assigns the supplied array of String values to the supplied key.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

delimiter

protected static char delimiter
Delimiter between property name & list member index

Constructor Detail

EnumeratedProperties

public EnumeratedProperties()
Method Detail

getEnumeratedProperty

public java.util.List getEnumeratedProperty(java.lang.String key)
Returns the List value of the property with the supplied key. Note that one can call getEnumeratedProperty() for a given key successfully if and only if setEnumeratedProperty() for that key was called some time beforehand. All members of the list returned will be Strings.

Parameters:
key - lookup of the enumerated property to be retrieved.
Returns:
list containing String values

setEnumeratedProperty

public void setEnumeratedProperty(java.lang.String key,
                                  java.lang.String[] values)
Assigns the supplied array of String values to the supplied key.

Parameters:
key - property lookup
values - values to be associated with the property lookup

setEnumeratedProperty

public void setEnumeratedProperty(java.lang.String key,
                                  java.util.List values)
Convenience method; equivalent to calling setEnumeratedProperty(key, (String[])values.toArray(new String[] {}));