All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.scalecube.config.DurationConfigPropertyImpl Maven / Gradle / Ivy

There is a newer version: 0.4.21.RC1
Show newest version
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