* Context: Add boolean getProperty methods

This commit is contained in:
zzz
2010-03-02 22:52:26 +00:00
parent ffbced22b3
commit ca9f174171

View File

@ -352,6 +352,32 @@ public class I2PAppContext {
return ival;
}
/**
* Return a boolean with a boolean default
* @since 0.7.12
*/
public boolean getProperty(String propName, boolean defaultVal) {
String val = getProperty(propName);
if (val == null)
return defaultVal;
return Boolean.valueOf(val).booleanValue();
}
/**
* Default false
* @since 0.7.12
*/
public boolean getBooleanProperty(String propName) {
return Boolean.valueOf(getProperty(propName)).booleanValue();
}
/**
* @since 0.7.12
*/
public boolean getBooleanPropertyDefaultTrue(String propName) {
return getProperty(propName, true);
}
/**
* Access the configuration attributes of this context, listing the properties
* provided during the context construction, as well as the ones included in