public abstract class Parameters extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Parameters.IDisposable |
| Constructor and Description |
|---|
Parameters() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addProperties(String fileName)
There must be a a file "
|
abstract void |
flush()
Resets the cached configuration, effectively enforcing a configuration reload when
properties are retrieved the next time.
|
abstract Object |
get(String name) |
boolean |
getBoolean(String name,
boolean defaultValue) |
Calendar |
getDate(String name)
We expect the format
yyyy-mm-dd. |
Calendar |
getDate(String name,
Calendar defaultValue)
We expect the format
yyyy-mm-dd. |
static String |
getDefaultProperties() |
double |
getDouble(String name,
double defaultValue)
Gets the value of the property.
|
int |
getInteger(String name,
int defaultValue)
Gets the value of the property.
|
long |
getLong(String name,
long defaultValue) |
<T> T |
getObject(String name) |
<T> T |
getObject(String name,
T defaultValue) |
String |
getString(String name)
Gets the value of the property.
|
String |
getString(String name,
String defaultValue)
Gets the value of the property.
|
List<String> |
getStrings(String name) |
List<String> |
getStrings(String name,
String separators)
Returns a list of values.
|
static Parameters |
instance() |
abstract void |
set(String name,
Object value) |
void |
setBoolean(String name,
boolean value) |
static void |
setDefaultProperties(String baseName)
There must be a a file "
|
void |
setInteger(String name,
int value) |
void |
setString(String name,
String value) |
public static void setDefaultProperties(String baseName)
instance().baseName - the name of the file storing your properties (e.g. "carnot" will render
"carnot.properties")public static String getDefaultProperties()
public static Parameters instance()
public <T> T getObject(String name)
public <T> T getObject(String name, T defaultValue)
public final String getString(String name)
name - the name of the propertynull.getString(String, String)public final String getString(String name, String defaultValue)
name - the name of the propertydefaultValue - the default value of the propertygetString(String)public final int getInteger(String name, int defaultValue)
name - the name of the propertydefaultValue - the default value of the propertypublic final long getLong(String name, long defaultValue)
public double getDouble(String name, double defaultValue)
name - the name of the propertydefaultValue - the default value of the propertypublic final boolean getBoolean(String name, boolean defaultValue)
public final Calendar getDate(String name, Calendar defaultValue)
yyyy-mm-dd.public final List<String> getStrings(String name, String separators)
public final void setInteger(String name, int value)
public final void setBoolean(String name, boolean value)
public abstract void flush()
public abstract void addProperties(String fileName)
fileName - the name of the file storing your properties (e.g. "carnot" will render
"carnot.properties")Copyright © 2016 Eclipse Stardust. All Rights Reserved.