@PublicAPI public class PACommonPropertiesHelper extends Object
Constructor and Description |
---|
PACommonPropertiesHelper(PAPropertiesLazyLoader propertiesLoader) |
Modifier and Type | Method and Description |
---|---|
String |
getCmdLine(String key)
Returns the string to be passed on the command line
The property surrounded by '-D' and '='
|
Map<String,Object> |
getPropertiesAsHashMap()
Return all properties as a HashMap.
|
boolean |
getValueAsBoolean(String key,
PropertyType type,
String defaultValue)
Returns the value of this property as a boolean.
|
int |
getValueAsInt(String key,
PropertyType type,
String defaultValue)
Returns the value of this property as an integer.
|
List<String> |
getValueAsList(String key,
PropertyType type,
String separator,
boolean allowEmpty,
String defaultValue)
Returns the value of this property as a List of strings.
|
long |
getValueAsLong(String key,
PropertyType type,
String defaultValue)
Returns the value of this property as an integer.
|
String |
getValueAsString(String key,
String defaultValue)
Returns the value of this property as a string.
|
String |
getValueAsStringOrNull(String key)
Returns the value of this property as a string.
|
boolean |
isSet(String key,
String defaultValue)
Return true if this property is set, false otherwise.
|
void |
unSet(String key)
unsets this property
|
void |
updateProperties(String filename)
Override properties defined in the default configuration file,
by properties defined in another file.
|
void |
updateProperty(String key,
String value)
Set the value of this property to the given one.
|
public PACommonPropertiesHelper(PAPropertiesLazyLoader propertiesLoader)
public void updateProperty(String key, String value)
value
- the new value to set.public boolean isSet(String key, String defaultValue)
public void unSet(String key)
public String getCmdLine(String key)
public void updateProperties(String filename)
filename
- path of file containing some properties to overridepublic Map<String,Object> getPropertiesAsHashMap()
public int getValueAsInt(String key, PropertyType type, String defaultValue)
public long getValueAsLong(String key, PropertyType type, String defaultValue)
public String getValueAsString(String key, String defaultValue)
public List<String> getValueAsList(String key, PropertyType type, String separator, boolean allowEmpty, String defaultValue)
separator
- the separator to usepublic String getValueAsStringOrNull(String key)
public boolean getValueAsBoolean(String key, PropertyType type, String defaultValue)
Boolean.parseBoolean(String s)
.