Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2013-2014 by Cisco Systems, Inc. All rights reserved.
  
  package com.cisco.oss.foundation.directory.config;
  
The SD API Configuration class. It allows application to get the property value, set a new property value and add ConfigurationListener in runtime.

Author(s):
zuxiang
 
 public class ServiceDirectoryConfig {
 	
Constructor of ServiceDirectoryConfig.

Parameters:
configuration the ServiceDirectory Configuration.
 
 	public ServiceDirectoryConfig(Configuration configuration){
 		this. = configuration;
 	}

Get the property object.

Parameters:
name property name.
Returns:
property value object.
 
 	public Object getProperty(String name){
 		return this..getProperty(name);
 	}

Get the property object as String.

Parameters:
name property name.
Returns:
property value as String.
 
 	public String getString(String name){
 		return this..getString(name);
 	}

Get the property object as String, or return defaultVal if property is not defined.

Parameters:
name property name.
defaultVal default property value.
Returns:
property value as String, return defaultVal if property is undefined.
 
 	public String getString(String nameString defaultVal){
 		if(this..containsKey(name)){
 			return this..getString(name);
 		} else {
 			return defaultVal;
 		}
 	}

Check whether the property is defined.

Parameters:
name property name.
Returns:
true if property defined already.
 
 	public boolean containsProperty(String name){
 		return this..containsKey(name);
 	}

Get the property object as Boolean.

Parameters:
name property name.
Returns:
property value as boolean.
 
 	public boolean getBoolean(String name){
 		return this..getBoolean(name);
 	}

Get the property object as Boolean, or return defaultVal if property is not defined.

Parameters:
name property name.
defaultVal default property value.
Returns:
property value as boolean, return defaultVal if property is undefined.
	public boolean getBoolean(String nameboolean defaultVal){
		if(this..containsKey(name)){
			return this..getBoolean(name);
else {
			return defaultVal;
		}
	}

Get the property object as double.

Parameters:
name property name.
Returns:
property value as double.
	public double getDouble(String name){
		return this..getDouble(name);
	}

Get the property object as double, or return defaultVal if property is not defined.

Parameters:
name property name.
defaultVal default property value.
Returns:
property value as double, return defaultVal if property is undefined.
	public double getDouble(String namedouble defaultVal){
		if(this..containsKey(name)){
			return this..getDouble(name);
else {
			return defaultVal;
		}
	}

Get the property object as float.

Parameters:
name property name.
Returns:
property value as float.
	public float getFloat(String name){
		return this..getFloat(name);
	}

Get the property object as float, or return defaultVal if property is not defined.

Parameters:
name property name.
defaultVal default property value.
Returns:
property value as float, return defaultVal if property is undefined.
	public float getFloat(String namefloat defaultVal){
		if(this..containsKey(name)){
			return this..getFloat(name);
else {
			return defaultVal;
		}
	}

Get the property object as int.

Parameters:
name property name.
Returns:
property value as int.
	public int getInt(String name){
		return this..getInt(name);
	}

Get the property object as int, or return defaultVal if property is not defined.

Parameters:
name property name.
defaultVal default property value.
Returns:
property value as int, return defaultVal if property is undefined.
	public int getInt(String nameint defaultVal){
		if(this..containsKey(name)){
			return this..getInt(name);
else {
			return defaultVal;
		}
	}

Get the property object as long.

Parameters:
name property name.
Returns:
property value as long.
	public long getLong(String name){
		return this..getLong(name);
	}

Get the property object as long, or return defaultVal if property is not defined.

Parameters:
name property name.
defaultVal default property value.
Returns:
property value as long, return defaultVal if property is undefined.
	public long getLong(String namelong defaultVal){
		if(this..containsKey(name)){
			return this..getLong(name);
else {
			return defaultVal;
		}
	}

Set the property object.

Parameters:
name property name.
value property value object.
	public void setProperty(String nameObject value){
		this..setProperty(namevalue);
	}
//	/**
//	 * Add a ConfigurationListener.
//	 * 
//	 * @param listener
//	 * 		the Configuration listener.
//	 */
//	public void addConfigurationListener(ConfigurationListener listener){
//		this.configuration.addConfigurationListener(listener);
//	}
//	
//	/**
//	 * Remove the ConfigurationListener.
//	 * 
//	 * @param listener
//	 * 		the Configuration listener.
//	 */
//	public void removeConfigurationListener(ConfigurationListener listener){
//		this.configuration.removeConfigurationListener(listener);
//	}
New to GrepCode? Check out our FAQ X