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

com.github.zhengframework.configuration.ConfigurationValueProvider Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.github.zhengframework.configuration;

import javax.inject.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class ConfigurationValueProvider implements Provider {

  private static final Logger log = LoggerFactory.getLogger(ConfigurationValueProvider.class);
  private final String key;
  private Configuration configuration;

  ConfigurationValueProvider(Configuration configuration, String key) {
    this.key = key;
    this.configuration = configuration;
  }

  @Override
  public String get() {
    log.debug("get value by key=[{}]", key);
    return configuration.get(key).orElse(null);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy