com.sodius.mdw.core.util
Class AbstractPropertySet

java.lang.Object
  extended by com.sodius.mdw.core.util.AbstractPropertySet
All Implemented Interfaces:
PropertySet
Direct Known Subclasses:
DefaultPropertySet

public abstract class AbstractPropertySet
extends Object
implements PropertySet

Skeletal implementation of the PropertySet interface.

Clients may subclass this class.

Since:
3.1.0

Constructor Summary
AbstractPropertySet()
           
 
Method Summary
 boolean getProperty(String name, boolean defaultValue)
          Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a boolean.
 float getProperty(String name, float defaultValue)
          Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a float.
 int getProperty(String name, int defaultValue)
          Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a int.
 String getProperty(String name, String defaultValue)
          Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a String.
 void setProperty(String name, boolean value)
          Associates the specified value with a property name.
 void setProperty(String name, float value)
          Associates the specified value with a property name.
 void setProperty(String name, int value)
          Associates the specified value with a property name.
 void setProperty(String name, String value)
          Associates the specified value with a property name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sodius.mdw.core.util.PropertySet
getProperty, getPropertyNames, setProperty
 

Constructor Detail

AbstractPropertySet

public AbstractPropertySet()
Method Detail

getProperty

public String getProperty(String name,
                          String defaultValue)
Description copied from interface: PropertySet
Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a String.

Specified by:
getProperty in interface PropertySet
Parameters:
name - the property name
defaultValue - the default value to use if the property is not found
Returns:
the property value

getProperty

public int getProperty(String name,
                       int defaultValue)
Description copied from interface: PropertySet
Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a int.

Specified by:
getProperty in interface PropertySet
Parameters:
name - the property name
defaultValue - the default value to use if the property is not found
Returns:
the property value

getProperty

public boolean getProperty(String name,
                           boolean defaultValue)
Description copied from interface: PropertySet
Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a boolean.

Specified by:
getProperty in interface PropertySet
Parameters:
name - the property name
defaultValue - the default value to use if the property is not found
Returns:
the property value

getProperty

public float getProperty(String name,
                         float defaultValue)
Description copied from interface: PropertySet
Returns the value mapped to the specified property name, or the specified default value if the property is not found or if it cannot be treated as a float.

Specified by:
getProperty in interface PropertySet
Parameters:
name - the property name
defaultValue - the default value to use if the property is not found
Returns:
the property value

setProperty

public void setProperty(String name,
                        String value)
Description copied from interface: PropertySet
Associates the specified value with a property name.

Specified by:
setProperty in interface PropertySet
Parameters:
name - the property name.
value - the property value (can be null)

setProperty

public void setProperty(String name,
                        int value)
Description copied from interface: PropertySet
Associates the specified value with a property name.

Specified by:
setProperty in interface PropertySet
Parameters:
name - the property name.
value - the property value

setProperty

public void setProperty(String name,
                        boolean value)
Description copied from interface: PropertySet
Associates the specified value with a property name.

Specified by:
setProperty in interface PropertySet
Parameters:
name - the property name.
value - the property value

setProperty

public void setProperty(String name,
                        float value)
Description copied from interface: PropertySet
Associates the specified value with a property name.

Specified by:
setProperty in interface PropertySet
Parameters:
name - the property name.
value - the property value