Convert config values to string if casting fails

This commit is contained in:
games647
2016-11-26 13:27:39 +01:00
parent 3851d539f8
commit 7f96d55084

View File

@ -13,6 +13,11 @@ public class SharedConfig {
@SuppressWarnings("unchecked")
public <T> T get(String path, T def) {
Object val = configValues.get(path);
if (def instanceof String) {
return (T) String.valueOf(val);
}
return ( val != null ) ? (T) val : def;
}