public class ConfigurationUtils extends Object
Constructor and Description |
---|
ConfigurationUtils() |
Modifier and Type | Method and Description |
---|---|
static ConcurrentCompositeConfiguration |
convertToConcurrentCompositeConfiguration(org.apache.commons.configuration.CombinedConfiguration config)
Convert CombinedConfiguration into
ConcurrentCompositeConfiguration as the later has better performance
and thread safety. |
static Map<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 Properties |
getProperties(org.apache.commons.configuration.AbstractConfiguration config)
Utility method to obtain
Properties given an instance of AbstractConfiguration . |
static void |
loadProperties(Properties props,
org.apache.commons.configuration.Configuration config) |
public static ConcurrentCompositeConfiguration convertToConcurrentCompositeConfiguration(org.apache.commons.configuration.CombinedConfiguration config)
ConcurrentCompositeConfiguration
as the later has better performance
and thread safety.config
- Configuration to be convertedpublic static Map<String,org.apache.commons.configuration.Configuration> getAllNamedConfiguration(org.apache.commons.configuration.Configuration conf)
ConcurrentCompositeConfiguration
or CombinedConfiguration and extract the
named configurations out of them.conf
- Configuration to get all the named sub-configurationspublic static Properties getProperties(org.apache.commons.configuration.AbstractConfiguration config)
Properties
given an instance of AbstractConfiguration
.
Returns an empty Properties
object if the config has no properties or is null.config
- Configuration to get the propertiespublic static void loadProperties(Properties props, org.apache.commons.configuration.Configuration config)
Copyright © 2017. All Rights Reserved.