io.scalecube.config.DurationConfigPropertyImpl Maven / Gradle / Ivy
package io.scalecube.config;
import io.scalecube.config.source.LoadedConfigProperty;
import java.time.Duration;
import java.util.Map;
class DurationConfigPropertyImpl extends AbstractSimpleConfigProperty
implements DurationConfigProperty {
DurationConfigPropertyImpl(
String name,
Map propertyMap,
Map> propertyCallbackMap) {
super(
name, Duration.class, propertyMap, propertyCallbackMap, ConfigRegistryImpl.DURATION_PARSER);
}
@Override
public Duration value(Duration defaultValue) {
return value().orElse(defaultValue);
}
@Override
public Duration valueOrThrow() {
return value().orElseThrow(this::newNoSuchElementException);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy