本文整理了Java中com.typesafe.config.Config.atKey()
方法的一些代码示例,展示了Config.atKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.atKey()
方法的具体详情如下:
包路径:com.typesafe.config.Config
类名称:Config
方法名:atKey
[英]Places the config inside a Config at the given key. See also atPath(). Note that a key is NOT a path expression (see ConfigUtil#joinPath and ConfigUtil#splitPath).
[中]将配置放置在给定键处的配置中。另请参见atPath()。请注意,键不是路径表达式(请参见ConfigUtil#joinPath和ConfigUtil#splitPath)。
代码示例来源:origin: apache/drill
@Override
public Config atKey(String key) {
return c.atKey(key);
}
代码示例来源:origin: apache/incubator-gobblin
/**
* Get a {@link org.apache.gobblin.broker.iface.ConfigView} for the input scope, key, and factory.
*/
public <K extends SharedResourceKey> KeyedScopedConfigViewImpl<S, K> getConfigView(S scope, K key, String factoryName) {
Config config = ConfigFactory.empty();
for (ScopedConfig<S> scopedConfig : this.scopedConfigs) {
if (scopedConfig.getScopeType().equals(scopedConfig.getScopeType().rootScope())) {
config = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName).withFallback(config);
} else if (scope != null && SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, scopedConfig.getScopeType())) {
Config tmpConfig = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName);
tmpConfig = ConfigUtils.getConfigOrEmpty(tmpConfig, scope.name());
config = tmpConfig.atKey(scope.name()).withFallback(config);
}
}
return new KeyedScopedConfigViewImpl<>(scope, key, factoryName, config);
}
代码示例来源:origin: dremio/dremio-oss
@Override
public Config atKey(String key) {
return config.atKey(key);
}
代码示例来源:origin: org.apache.drill/drill-common
@Override
public Config atKey(String key) {
return c.atKey(key);
}
代码示例来源:origin: com.linkedin.gobblin/gobblin-utility
/**
* Get a {@link gobblin.broker.iface.ConfigView} for the input scope, key, and factory.
*/
public <K extends SharedResourceKey> KeyedScopedConfigViewImpl<S, K> getConfigView(S scope, K key, String factoryName) {
Config config = ConfigFactory.empty();
for (ScopedConfig<S> scopedConfig : this.scopedConfigs) {
if (scopedConfig.getScopeType().equals(scopedConfig.getScopeType().rootScope())) {
config = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName).withFallback(config);
} else if (scope != null && SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, scopedConfig.getScopeType())) {
Config tmpConfig = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName);
tmpConfig = ConfigUtils.getConfigOrEmpty(tmpConfig, scope.name());
config = tmpConfig.atKey(scope.name()).withFallback(config);
}
}
return new KeyedScopedConfigViewImpl<>(scope, key, factoryName, config);
}
代码示例来源:origin: org.apache.gobblin/gobblin-utility
/**
* Get a {@link org.apache.gobblin.broker.iface.ConfigView} for the input scope, key, and factory.
*/
public <K extends SharedResourceKey> KeyedScopedConfigViewImpl<S, K> getConfigView(S scope, K key, String factoryName) {
Config config = ConfigFactory.empty();
for (ScopedConfig<S> scopedConfig : this.scopedConfigs) {
if (scopedConfig.getScopeType().equals(scopedConfig.getScopeType().rootScope())) {
config = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName).withFallback(config);
} else if (scope != null && SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, scopedConfig.getScopeType())) {
Config tmpConfig = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName);
tmpConfig = ConfigUtils.getConfigOrEmpty(tmpConfig, scope.name());
config = tmpConfig.atKey(scope.name()).withFallback(config);
}
}
return new KeyedScopedConfigViewImpl<>(scope, key, factoryName, config);
}
内容来源于网络,如有侵权,请联系作者删除!