public final class HoconConfigUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
asConfigKey(String path)
Returns a string that will be interpreted by the typesafe config library as a single
key instead of as a path through nested configurations.
|
static String |
asConfigPath(String key)
Returns a string that will be interpreted by the typesafe config library as a path through
nested configurations, instead of as a single key.
|
static com.typesafe.config.Config |
getSectionConfiguration(com.typesafe.config.Config config,
com.google.common.base.Optional<String> sectionKey)
Returns the specified optional configuration subsection.
|
static com.typesafe.config.Config |
getSectionConfiguration(com.typesafe.config.Config config,
String sectionKey)
Returns the specified configuration subsection.
|
static Map<String,String> |
getStringMap(com.typesafe.config.Config config,
String key)
Returns a map view of the data associated with the specified key.
|
static String |
stripQuotes(String key)
Returns a key that has any matched pair of double quotes present at the beginning and end of
the key removed.
|
public static String asConfigKey(String path)
path
- the path, which may contain periodspublic static String asConfigPath(String key)
key
- the keypublic static String stripQuotes(String key)
key
- the keypublic static Map<String,String> getStringMap(com.typesafe.config.Config config, String key)
config
- the configurationkey
- the keypublic static com.typesafe.config.Config getSectionConfiguration(com.typesafe.config.Config config, com.google.common.base.Optional<String> sectionKey)
config
- the optional configurationsectionKey
- the optional desired configuration subsectionpublic static com.typesafe.config.Config getSectionConfiguration(com.typesafe.config.Config config, String sectionKey)
config
- the configurationsectionKey
- the desired configuration subsectionCopyright © 2016. All rights reserved.