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

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

package io.scalecube.config;

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

class LongConfigPropertyImpl extends AbstractSimpleConfigProperty
    implements LongConfigProperty {

  LongConfigPropertyImpl(
      String name,
      Map propertyMap,
      Map> propertyCallbackMap) {
    super(name, Long.class, propertyMap, propertyCallbackMap, ConfigRegistryImpl.LONG_PARSER);
  }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy