de.cau.cs.kieler.core.util
Class PropertyHolder

java.lang.Object
  extended by de.cau.cs.kieler.core.util.PropertyHolder

public abstract class PropertyHolder
extends Object

An abstract holder class for properties.

Rating red

Constructor Summary
PropertyHolder()
           
 
Method Summary
 void copyProperties(PropertyHolder other)
          Copy all properties from another property holder to this one.
<T> T
getProperty(Property<T> property)
          Retrieves a property value.
 void setProperty(Property<?> property, Object value)
          Sets a property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHolder

public PropertyHolder()
Method Detail

setProperty

public void setProperty(Property<?> property,
                        Object value)
Sets a property value.

Parameters:
property - the property to set
value - the new value

getProperty

public <T> T getProperty(Property<T> property)
Retrieves a property value.

Type Parameters:
T - type of property
Parameters:
property - the property to get
Returns:
the current value, or the default value if the property is not set

copyProperties

public void copyProperties(PropertyHolder other)
Copy all properties from another property holder to this one.

Parameters:
other - another property holder