com.netflix.config.util
Class ConfigurationUtils

java.lang.Object
  extended by com.netflix.config.util.ConfigurationUtils

public class ConfigurationUtils
extends java.lang.Object

Utility class for configuration.


Constructor Summary
ConfigurationUtils()
           
 
Method Summary
static ConcurrentCompositeConfiguration convertToConcurrentCompositeConfiguration(org.apache.commons.configuration.CombinedConfiguration config)
          Convert CombinedConfiguration into ConcurrentCompositeConfiguration as the later has better performance and thread safety.
static java.util.Map<java.lang.String,org.apache.commons.configuration.Configuration> getAllNamedConfiguration(org.apache.commons.configuration.Configuration conf)
          Gets all named sub-configuration from a configuration in a map.
static java.util.Properties getProperties(org.apache.commons.configuration.AbstractConfiguration config)
          Utility method to obtain Properties given an instance of AbstractConfiguration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationUtils

public ConfigurationUtils()
Method Detail

convertToConcurrentCompositeConfiguration

public static ConcurrentCompositeConfiguration convertToConcurrentCompositeConfiguration(org.apache.commons.configuration.CombinedConfiguration config)
Convert CombinedConfiguration into ConcurrentCompositeConfiguration as the later has better performance and thread safety.

Parameters:
config - Configuration to be converted

getAllNamedConfiguration

public static java.util.Map<java.lang.String,org.apache.commons.configuration.Configuration> getAllNamedConfiguration(org.apache.commons.configuration.Configuration conf)
Gets all named sub-configuration from a configuration in a map. This method examines each sub-configuration which is an instance of ConcurrentCompositeConfiguration or CombinedConfiguration and extract the named configurations out of them.

Parameters:
conf - Configuration to get all the named sub-configurations
Returns:
map where key is the name of the sub-configuration and value is the sub-configuration

getProperties

public static java.util.Properties getProperties(org.apache.commons.configuration.AbstractConfiguration config)
Utility method to obtain Properties given an instance of AbstractConfiguration. Returns an empty Properties object if the config has no properties or is null.

Parameters:
config - Configuration to get the properties
Returns:
properties extracted from the configuration