make getDuration return unboxed long

This way it's clear it can't be null
This commit is contained in:
Havoc Pennington 2014-01-08 10:44:44 -05:00
parent 42933ebc99
commit 4dd6c85cab
2 changed files with 3 additions and 3 deletions

View File

@ -610,7 +610,7 @@ public interface Config extends ConfigMergeable {
* @throws ConfigException.BadValue
* if value cannot be parsed as a number of the given TimeUnit
*/
Long getDuration(String path, TimeUnit unit);
long getDuration(String path, TimeUnit unit);
/**
* Gets a list value (with any element type) as a {@link ConfigList}, which

View File

@ -256,9 +256,9 @@ final class SimpleConfig implements Config, MergeableValue, Serializable {
}
@Override
public Long getDuration(String path, TimeUnit unit) {
public long getDuration(String path, TimeUnit unit) {
ConfigValue v = find(path, ConfigValueType.STRING);
Long result = unit.convert(
long result = unit.convert(
parseDuration((String) v.unwrapped(), v.origin(), path),
TimeUnit.NANOSECONDS);
return result;