public class ConfigUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BAMBOO_DELIMITER_PARSING_DISABLED |
Modifier and Type | Method and Description |
---|---|
static void |
addMapToBuilConfiguration(String mapKey,
Map<String,String> map,
org.apache.commons.configuration.HierarchicalConfiguration configuration)
|
static void |
addMapToConfiguration(String mapConfigKey,
Map<String,String> map,
org.apache.commons.configuration.HierarchicalConfiguration configuration) |
static void |
addMapToConfiguration(String mapConfigKey,
String entryConfigKey,
Map<String,String> map,
org.apache.commons.configuration.HierarchicalConfiguration configuration) |
static void |
addNodeAt(org.apache.commons.configuration.HierarchicalConfiguration configuration,
String rootPath,
org.apache.commons.configuration.HierarchicalConfiguration configToAdd) |
static void |
addNodesAt(org.apache.commons.configuration.HierarchicalConfiguration config,
String rootPath,
org.apache.commons.configuration.HierarchicalConfiguration configToAdd) |
static Map<String,String> |
asMap(org.apache.commons.configuration.Configuration config,
String filter) |
static Map<String,Object> |
asObjectMap(org.apache.commons.configuration.Configuration config) |
static Map<String,Object> |
asObjectMap(org.apache.commons.configuration.Configuration config,
String filter) |
static String |
asXmlString(org.apache.commons.configuration.HierarchicalConfiguration hierarchicalConfiguration) |
static String |
asXmlString(org.apache.commons.configuration.XMLConfiguration configuration) |
static void |
copyMapToConfig(Map<String,String> map,
org.apache.commons.configuration.Configuration config) |
static void |
copyNodes(org.apache.commons.configuration.HierarchicalConfiguration sourceConfig,
org.apache.commons.configuration.HierarchicalConfiguration targetConfig) |
static void |
copyNodes(org.apache.commons.configuration.HierarchicalConfiguration sourceConfig,
org.apache.commons.configuration.HierarchicalConfiguration targetConfig,
String key) |
static void |
copyObjectMapToConfig(Map<String,Object> map,
org.apache.commons.configuration.Configuration config) |
static Map<String,String> |
getMapFromConfiguration(String mapConfigKey,
org.apache.commons.configuration.HierarchicalConfiguration configuration) |
static Map<String,String> |
getMapFromConfiguration(String mapConfigKey,
String entryConfigKey,
org.apache.commons.configuration.HierarchicalConfiguration configuration) |
static <T> List<T> |
getPropertyAsList(org.apache.commons.configuration.HierarchicalConfiguration configuration,
String propertyName,
Class<T> propertyType)
Returns a given property from the configuration as a list of given type.
|
static <T> List<T> |
getPropertyAsList(Map<String,Object> configuration,
String propertyName,
Class<T> propertyType)
Returns a given property from the configuration as a list of given type.
|
static org.apache.commons.configuration.XMLConfiguration |
getXmlConfigFromXmlString(String xmlData) |
static org.apache.commons.configuration.XMLConfiguration |
getXmlConfigFromXmlString(String xmlData,
boolean delimiterParsingDisabled)
Deprecated.
since 5.2 use $
getXmlConfigFromXmlString(java.lang.String) |
static org.apache.commons.configuration.XMLConfiguration |
newConfiguration() |
static org.apache.commons.configuration.XMLConfiguration |
newConfiguration(boolean isDelimiterParsingDisabled) |
static org.apache.commons.configuration.XMLConfiguration |
newConfiguration(org.apache.commons.configuration.HierarchicalConfiguration configuration) |
static void |
sanitiseAndSave(org.apache.commons.configuration.XMLConfiguration configuration,
Writer buildXml)
Deprecated.
|
static Map<String,Long> |
toLongMap(Map<String,String> stringMap) |
static Map<String,String> |
toStringMap(Map<String,?> objectsMap) |
public static final String BAMBOO_DELIMITER_PARSING_DISABLED
public static void copyMapToConfig(@NotNull Map<String,String> map, @NotNull org.apache.commons.configuration.Configuration config)
public static void copyObjectMapToConfig(@NotNull Map<String,Object> map, @NotNull org.apache.commons.configuration.Configuration config)
@NotNull public static Map<String,String> asMap(@NotNull org.apache.commons.configuration.Configuration config, @Nullable String filter)
public static Map<String,Object> asObjectMap(@NotNull org.apache.commons.configuration.Configuration config)
@NotNull public static Map<String,Object> asObjectMap(@NotNull org.apache.commons.configuration.Configuration config, @Nullable String filter)
public static void addNodesAt(org.apache.commons.configuration.HierarchicalConfiguration config, String rootPath, org.apache.commons.configuration.HierarchicalConfiguration configToAdd)
public static void addNodeAt(org.apache.commons.configuration.HierarchicalConfiguration configuration, String rootPath, org.apache.commons.configuration.HierarchicalConfiguration configToAdd)
public static void addMapToConfiguration(@NotNull String mapConfigKey, @NotNull String entryConfigKey, @NotNull Map<String,String> map, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
public static void addMapToConfiguration(@NotNull String mapConfigKey, @NotNull Map<String,String> map, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
@Deprecated public static void addMapToBuilConfiguration(@NotNull String mapKey, @NotNull Map<String,String> map, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
@NotNull public static Map<String,String> getMapFromConfiguration(@NotNull String mapConfigKey, @NotNull String entryConfigKey, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
@NotNull public static Map<String,String> getMapFromConfiguration(@NotNull String mapConfigKey, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
@NotNull public static Map<String,String> toStringMap(@NotNull Map<String,?> objectsMap)
@NotNull public static Map<String,Long> toLongMap(@NotNull Map<String,String> stringMap) throws NumberFormatException
NumberFormatException
@Deprecated public static void sanitiseAndSave(@NotNull org.apache.commons.configuration.XMLConfiguration configuration, @NotNull Writer buildXml) throws org.apache.commons.configuration.ConfigurationException
CommonsConfigUtils.sanitiseAndSave(org.apache.commons.configuration.XMLConfiguration, java.io.Writer)
insteadorg.apache.commons.configuration.ConfigurationException
public static String asXmlString(@NotNull org.apache.commons.configuration.HierarchicalConfiguration hierarchicalConfiguration)
@NotNull public static String asXmlString(@NotNull org.apache.commons.configuration.XMLConfiguration configuration)
@NotNull public static org.apache.commons.configuration.XMLConfiguration getXmlConfigFromXmlString(@NotNull String xmlData)
@Deprecated @NotNull public static org.apache.commons.configuration.XMLConfiguration getXmlConfigFromXmlString(@NotNull String xmlData, boolean delimiterParsingDisabled)
getXmlConfigFromXmlString(java.lang.String)
public static void copyNodes(@NotNull org.apache.commons.configuration.HierarchicalConfiguration sourceConfig, @NotNull org.apache.commons.configuration.HierarchicalConfiguration targetConfig)
public static void copyNodes(@NotNull org.apache.commons.configuration.HierarchicalConfiguration sourceConfig, @NotNull org.apache.commons.configuration.HierarchicalConfiguration targetConfig, @Nullable String key)
public static org.apache.commons.configuration.XMLConfiguration newConfiguration()
public static org.apache.commons.configuration.XMLConfiguration newConfiguration(boolean isDelimiterParsingDisabled)
public static org.apache.commons.configuration.XMLConfiguration newConfiguration(org.apache.commons.configuration.HierarchicalConfiguration configuration)
@NotNull public static <T> List<T> getPropertyAsList(@NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration, @NotNull String propertyName, @NotNull Class<T> propertyType)
configuration
- configuration to fetch propertypropertyName
- name of the propertypropertyType
- expected type of each element from the property value as a listClassCastException
- if the provided type is incorrect, e.g. the property is a list, but of a different
type@NotNull public static <T> List<T> getPropertyAsList(@NotNull Map<String,Object> configuration, @NotNull String propertyName, @NotNull Class<T> propertyType)
configuration
- configuration to fetch propertypropertyName
- name of the propertypropertyType
- expected type of each element from the property value as a listClassCastException
- if the provided type is incorrect, e.g. the property is a list, but of a different
typeCopyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.