public class ConfigProperties extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ConfigProperties.ConfigProperty |
Constructor and Description |
---|
ConfigProperties(Map<String,String> configuredValues)
Creates a new container of configured values from which specific config properties can be obtained.
|
ConfigProperties(Properties configuredValues)
Creates a new container of configured values from which specific config properties can be obtained.
|
Modifier and Type | Method and Description |
---|---|
ConfigProperties.ConfigProperty |
get(String name,
String defaultValue)
Returns the ConfigProperty instance corresponding to the configured value of the given property, or the default
if no configured value exists.
|
String |
getConfigurationSummary(String heading)
Returns a multi-line string containing a list of all the properties that were retrieved from this instance, in
the order they were retrieved.
|
public ConfigProperties(Map<String,String> configuredValues)
configuredValues
- The configured values, which may have been hardcoded in a Map, read from a config file, or whatever.public ConfigProperties(Properties configuredValues)
configuredValues
- The configured values, which may have been read from a properties file, or obtained from
System.getProperties()
. If the property set contains entries whose key and value are not both
Strings, these entries will be ignored.public ConfigProperties.ConfigProperty get(String name, String defaultValue)
name
- the property name. Must not be null.defaultValue
- the value to use if no configured value exists. May be null.public String getConfigurationSummary(String heading)
heading
- a line of text to print before listing the configuration valuesCopyright © 2012–2018 JBoss by Red Hat. All rights reserved.