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

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

package io.scalecube.config;

import io.scalecube.config.source.LoadedConfigProperty;
import java.util.Map;

class DoubleConfigPropertyImpl extends AbstractSimpleConfigProperty
    implements DoubleConfigProperty {

  DoubleConfigPropertyImpl(
      String name,
      Map propertyMap,
      Map> propertyCallbackMap) {
    super(name, Double.class, propertyMap, propertyCallbackMap, ConfigRegistryImpl.DOUBLE_PARSER);
  }

  @Override
  public double value(double defaultValue) {
    return value().orElse(defaultValue);
  }

  @Override
  public double valueOrThrow() {
    return value().orElseThrow(this::newNoSuchElementException);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy