public class ConfigProps extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static ConfigProps |
EMPTY |
Constructor and Description |
---|
ConfigProps(Iterable<ConfigurationProperty> props)
Takes a snapshot of some ConfigurationProperty instances.
|
ConfigProps(Map<String,List<String>> map)
Construct from a map (for testing).
|
ConfigProps(ModuleDef def)
Takes a snapshot of a module's configuration properties.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(String key,
boolean defaultValue)
Returns a single-valued property as a boolean if possible.
|
List<String> |
getCommaSeparatedStrings(String key)
Reads a configuration property as a comma-separated list of strings.
|
int |
getInteger(String key,
int defaultValue)
Returns a single-valued configuration property as an integer if possible.
|
List<String> |
getStrings(String key)
Returns all the values of a multi-valued configuration property, or an empty list
if not found.
|
public static final ConfigProps EMPTY
public ConfigProps(Iterable<ConfigurationProperty> props)
public ConfigProps(ModuleDef def)
public boolean getBoolean(String key, boolean defaultValue)
public int getInteger(String key, int defaultValue)
public List<String> getStrings(String key)
A single-valued and unset configuration property will be returned as a list containing one null.
public List<String> getCommaSeparatedStrings(String key)
Leading and trailing space is automatically trimmed, and nulls and empty strings are automatically ignored.
Returns an empty list if the property doesn't exist.
Copyright © 2018. All rights reserved.