com.cisco.provisioning.cpe.extensions.services
Class CSRCProperties

java.lang.Object
  extended by com.cisco.provisioning.cpe.extensions.services.CSRCProperties

public abstract class CSRCProperties
extends Object

The CSRCProperties interface defines property accessor methods that allow extension points to query CSRC properties. This interface is similar to the java.lang.Properties class, but differs in that it supports more data types than String (e.g., boolean, int, long). It is left to the classes that implement CSRCProperties to define the allowable property keys and property values/data types.


Constructor Summary
CSRCProperties()
           
 
Method Summary
 Map getAllProperties()
          Returns a Map of available properties from property set.
abstract  boolean getBooleanProperty(String key)
          Return the value of the named property as a boolean.
abstract  int getIntProperty(String key)
          Return the value of the named property as an integer.
abstract  long getLongProperty(String key)
          Return the value of the named property as a long.
abstract  Object getObjectProperty(String key)
          Returns the value of the named property as an Object.
abstract  Object getObjectProperty(String key, Object defaultValue)
          Returns the value of the named property as a long.
abstract  String getProperty(String key)
          Return the value of the named property.
abstract  boolean getProperty(String key, boolean defaultValue)
          Return the value of the named property as a boolean.
abstract  int getProperty(String key, int defaultValue)
          Return the value of the named property as an integer.
abstract  long getProperty(String key, long defaultValue)
          Return the value of the named property as a long.
abstract  String getProperty(String key, String defaultValue)
          Return the value of the named roperty returning a default value if a property of the specified key is not in the list of properties (or in the default list of properties).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSRCProperties

public CSRCProperties()
Method Detail

getBooleanProperty

public abstract boolean getBooleanProperty(String key)
Return the value of the named property as a boolean. If the property can not be found or the property value can not be parsed as a boolean, throw an exception.

Parameters:
key - The property key.
Returns:
The value of the property as a boolean.
Throws:
IllegalArgumentException - if the property defined by the key is not found, or the property value can not be parsed as a boolean.

getProperty

public abstract boolean getProperty(String key,
                                    boolean defaultValue)
Return the value of the named property as a boolean. If the property can not be found then return the default value. If the property value can not be parsed as a boolean, throw an exception.

Parameters:
key - The property key.
defaultValue - The value to return if the property is not found.
Returns:
The value of the property or the default value.
Throws:
IllegalArgumentException - if the value is not a boolean.

getProperty

public abstract String getProperty(String key,
                                   String defaultValue)
Return the value of the named roperty returning a default value if a property of the specified key is not in the list of properties (or in the default list of properties).

Parameters:
key - the property key
defaultValue - the value to return if property does not exists
Returns:
the value of the property or the default value

getProperty

public abstract String getProperty(String key)
Return the value of the named property. If the property cannot be found an exception is thrown.

Parameters:
key - the property key
Returns:
the value of the property
Throws:
IllegalArgumentException - if property key not found.

getProperty

public abstract int getProperty(String key,
                                int defaultValue)
Return the value of the named property as an integer. If the property cannot be found then return the default value.

Parameters:
key - the property key
defaultValue - the value to return if the property is not found
Returns:
the value of the property or the default
Throws:
IllegalArgumentException - if property key not found.

getIntProperty

public abstract int getIntProperty(String key)
Return the value of the named property as an integer. If the property cannot be found then return the default value.

Parameters:
key - the property key
Returns:
the value of the property or the default

getLongProperty

public abstract long getLongProperty(String key)
Return the value of the named property as a long.

Parameters:
key - the property key.
Returns:
the value of the property.
Throws:
IllegalArgumentException - if the property defined by the key is not found.

getProperty

public abstract long getProperty(String key,
                                 long defaultValue)
Return the value of the named property as a long. If the property cannot be found then return the default value.

Parameters:
key - the property key
defaultValue - the value to return if the property is not found
Returns:
the value of the property or the default

getObjectProperty

public abstract Object getObjectProperty(String key)
Returns the value of the named property as an Object.

Parameters:
key - the property key
Returns:
the value of the property
Throws:
IllegalArgumentException - if property key not found.

getObjectProperty

public abstract Object getObjectProperty(String key,
                                         Object defaultValue)
Returns the value of the named property as a long. If the property cannot be found then return the default value.

Parameters:
key - the property key
defaultValue - the value to return if the property is not found
Returns:
the value of the property or the default

getAllProperties

public Map getAllProperties()
Returns a Map of available properties from property set.

Returns:
Map the key is a string property name, the value is property value
Throws:
UnsupportedOperationException - if this method is called on property collection that does not suppor this feature