Seems byte was only partially added here.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6100 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2010-07-20 01:11:55 +00:00
parent 73900f891d
commit 1bfc69aa49
3 changed files with 20 additions and 9 deletions
@@ -234,6 +234,8 @@ public abstract class ConfigRegistry
String key = nameToKey(name);
if (value instanceof Boolean) {
setValue(key, ((Boolean)value).booleanValue());
} else if (value instanceof Byte) {
setValue(key, ((Byte)value).byteValue());
} else if (value instanceof Short) {
setValue(key, ((Short)value).shortValue());
} else if (value instanceof Integer) {
@@ -407,6 +409,7 @@ public abstract class ConfigRegistry
protected abstract String[] getValue (String field, String[] defval);
protected abstract void setValue (String field, boolean value);
protected abstract void setValue (String field, byte value);
protected abstract void setValue (String field, short value);
protected abstract void setValue (String field, int value);
protected abstract void setValue (String field, long value);
@@ -141,6 +141,15 @@ public class DatabaseConfigRegistry extends ConfigRegistry
super.init();
}
@Override
protected boolean getValue (String field, boolean defval) {
String value = _data.get(field);
if (value != null) {
return "true".equalsIgnoreCase(value);
}
return defval;
}
@Override
protected byte getValue (String field, byte defval) {
String value = _data.get(field);
@@ -154,15 +163,6 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval;
}
@Override
protected boolean getValue (String field, boolean defval) {
String value = _data.get(field);
if (value != null) {
return "true".equalsIgnoreCase(value);
}
return defval;
}
@Override
protected short getValue (String field, short defval) {
String value = _data.get(field);
@@ -287,6 +287,10 @@ public class DatabaseConfigRegistry extends ConfigRegistry
setAndFlush(field, String.valueOf(value));
}
@Override
protected void setValue (String field, byte value) {
setAndFlush(field, String.valueOf(value));
}
@Override
protected void setValue (String field, short value) {
setAndFlush(field, String.valueOf(value));
}
@@ -102,6 +102,10 @@ public class PrefsConfigRegistry extends ConfigRegistry
config.setValue(field, value);
}
@Override
protected void setValue (String field, byte value) {
config.setValue(field, value);
}
@Override
protected void setValue (String field, short value) {
config.setValue(field, value);
}