hocon per se is a good stuff; but Typesafe's implementation, Config, is not something I feel happy with.
First, it is JAVA!!!!
Second, where's "getOrElse"? getInt could have a default value, right? Or a default Option value, which is better. Or have a lift that would be returning an option
Third, how about ++ and the like?
Fourth, what is this:
public enum ConfigValueType {
OBJECT, LIST, NUMBER, BOOLEAN, NULL, STRING
}
This is also funny:
@Override
public Long getMilliseconds(String path) {
long ns = getNanoseconds(path);
long ms = TimeUnit.NANOSECONDS.toMillis(ns);
return ms;
}
@Override
public Long getNanoseconds(String path) {
Long ns = null;
try {
ns = TimeUnit.MILLISECONDS.toNanos(getLong(path));
} catch (ConfigException.WrongType e) {
ConfigValue v = find(path, ConfigValueType.STRING);
ns = parseDuration((String) v.unwrapped(), v.origin(), path);
}
return ns;
}
In short, I'm thinking of abandoning it. Might make sense to write our own stuff, I don't know. So far my
Props
work well.