public class ConfigurationProperties extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static ConfigurationProperties |
EMPTY |
Constructor and Description |
---|
ConfigurationProperties(Iterable<ConfigurationProperty> properties)
Takes a snapshot of some ConfigurationProperty instances.
|
ConfigurationProperties(Map<String,List<String>> map)
Construct from a map (for testing).
|
ConfigurationProperties(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.
|
String |
getString(String key,
String defaultValue)
Returns a single-valued property as a string if possible.
|
List<String> |
getStrings(String key)
Returns all the values of a multi-valued configuration property, or an empty list
if not found.
|
boolean |
isMultiValued(String key)
Returns whether the property is multivalued or not.
|
public static final ConfigurationProperties EMPTY
public ConfigurationProperties(Iterable<ConfigurationProperty> properties)
public ConfigurationProperties(ModuleDef def)
public boolean getBoolean(String key, boolean defaultValue)
public int getInteger(String key, int defaultValue)
public String getString(String key, String 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.
public boolean isMultiValued(String key)
Copyright © 2018. All rights reserved.