public class ResourceManager extends Object
Constructor and Description |
---|
ResourceManager(Properties props_)
construct a ResourceManager with a Properties object
|
ResourceManager(String configFile_) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key) |
boolean |
getBoolean(Property property) |
boolean |
getBoolean(String propertyName_) |
boolean |
getBoolean(String propertyName_,
String defaultVal_) |
String[] |
getCommaSeparatedValues(Property property) |
String[] |
getCommaSeparatedValues(String propertyName_) |
boolean |
getCuratorForceUpdate() |
String |
getCuratorHost()
define some commonly used config value getters
|
int |
getCuratorPort() |
boolean |
getDebug() |
double |
getDouble(Property property) |
double |
getDouble(String propertyName_) |
double |
getDouble(String propertyName_,
String defaultVal_)
getters with default values -- won't throw exceptions
|
int |
getInt(Property property) |
int |
getInt(String propertyName_) |
int |
getInt(String propertyName_,
String defaultVal_) |
Enumeration<Object> |
getKeys() |
Properties |
getProperties()
return the Properties object built by this ResourceManager
|
String |
getString(Property property) |
String |
getString(String propertyName_) |
String |
getString(String propertyName_,
String defaultVal_) |
static void |
readSet(String resourceName,
Set<String> myset,
boolean lowercase,
boolean padSpace)
read a set of values from a file, expecting one value per line
|
public ResourceManager(String configFile_) throws IOException
IOException
public ResourceManager(Properties props_)
props_
- a Properties object with the properties setpublic Properties getProperties()
public static void readSet(String resourceName, Set<String> myset, boolean lowercase, boolean padSpace)
resourceName
- file (may be on classpath)myset
- set to populatelowercase
- if 'true', lowercase the set elements on readpadSpace
- if 'true', add whitespace on each side of element readpublic Enumeration<Object> getKeys()
public boolean containsKey(String key)
public double getDouble(String propertyName_)
public double getDouble(Property property)
public boolean getBoolean(String propertyName_)
public boolean getBoolean(Property property)
public int getInt(String propertyName_)
public int getInt(Property property)
public double getDouble(String propertyName_, String defaultVal_)
public String getCuratorHost()
public int getCuratorPort()
public boolean getCuratorForceUpdate()
public boolean getDebug()
Copyright © 2017. All rights reserved.