org.nuiton.util.config
Class SimpleConfig<E extends Enum<E>>

java.lang.Object
  extended by org.nuiton.util.config.SimpleConfig<E>
All Implemented Interfaces:
Config<E>
Direct Known Subclasses:
SimpleIdentityConfig

public class SimpleConfig<E extends Enum<E>>
extends Object
implements Config<E>

simple config implementation based on a Enum to obtain properties

Author:
chemit

Field Summary
protected  Class<E> klass
           
protected static org.apache.commons.logging.Log log
           
protected  EnumMap<E,Object> properties
           
protected  EnumSet<E> universe
           
 
Constructor Summary
SimpleConfig(Class<E> klass)
           
SimpleConfig(Class<E> klass, EnumMap<E,Object> properties)
           
 
Method Summary
 void copyFrom(Object src)
           
 void copyFrom(Object src, EnumSet<E> keys)
           
 void copyTo(Object dst)
           
 void copyTo(Object dst, EnumSet<E> keys)
           
 EnumMap<E,Object> getProperties()
           
 Object getProperty(E key)
           
 EnumSet<E> getUniverse()
           
 void setProperties(EnumMap<E,Object> properties)
           
 void setProperty(E key, Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

properties

protected EnumMap<E extends Enum<E>,Object> properties

universe

protected final EnumSet<E extends Enum<E>> universe

klass

protected final Class<E extends Enum<E>> klass
Constructor Detail

SimpleConfig

public SimpleConfig(Class<E> klass)

SimpleConfig

public SimpleConfig(Class<E> klass,
                    EnumMap<E,Object> properties)
Method Detail

getProperties

public EnumMap<E,Object> getProperties()
Specified by:
getProperties in interface Config<E extends Enum<E>>

getProperty

public Object getProperty(E key)
Specified by:
getProperty in interface Config<E extends Enum<E>>

getUniverse

public EnumSet<E> getUniverse()
Specified by:
getUniverse in interface Config<E extends Enum<E>>

setProperties

public void setProperties(EnumMap<E,Object> properties)
Specified by:
setProperties in interface Config<E extends Enum<E>>

setProperty

public void setProperty(E key,
                        Object value)
Specified by:
setProperty in interface Config<E extends Enum<E>>

copyFrom

public void copyFrom(Object src)
Specified by:
copyFrom in interface Config<E extends Enum<E>>

copyFrom

public void copyFrom(Object src,
                     EnumSet<E> keys)
Specified by:
copyFrom in interface Config<E extends Enum<E>>

copyTo

public void copyTo(Object dst)
Specified by:
copyTo in interface Config<E extends Enum<E>>

copyTo

public void copyTo(Object dst,
                   EnumSet<E> keys)
Specified by:
copyTo in interface Config<E extends Enum<E>>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2010 CodeLutin. All Rights Reserved.