Cleaned up database initialisation.

This commit is contained in:
akwizgran
2016-01-22 10:59:52 +00:00
parent cd175fd119
commit 093e44d3ab
7 changed files with 51 additions and 42 deletions

View File

@@ -26,4 +26,18 @@ abstract class StringMap extends Hashtable<String, String> {
public void putBoolean(String key, boolean value) {
put(key, String.valueOf(value));
}
public int getInt(String key, int defaultValue) {
String s = get(key);
if (s == null) return defaultValue;
try {
return Integer.valueOf(s);
} catch (NumberFormatException e) {
return defaultValue;
}
}
public void putInt(String key, int value) {
put(key, String.valueOf(value));
}
}