本文整理汇总了Java中com.typesafe.config.Config.getIntList方法的典型用法代码示例。如果您正苦于以下问题:Java Config.getIntList方法的具体用法?Java Config.getIntList怎么用?Java Config.getIntList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.typesafe.config.Config
的用法示例。
在下文中一共展示了Config.getIntList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FFMModelDataFlow
import com.typesafe.config.Config; //导入方法依赖的package包/类
public FFMModelDataFlow(IFileSystem fs,
Config config,
ThreadCommSlave comm,
int threadNum,
boolean needPyTransform,
String pyTransformScript) throws Exception {
super(fs, config,
comm,
threadNum,
needPyTransform,
pyTransformScript);
List<Integer> klist = config.getIntList("k");
K = new int[klist.size()];
for (int i = 0; i < klist.size(); i++) {
K[i] = klist.get(i);
}
//seed = config.getInt("seed");
biasNeedLatentFactor = config.getBoolean("bias_need_latent_factor");
needFirstOrder = (K[0] >= 1);
needSecondOrder = (K[1] >= 1);
fieldDelim = config.getString("data.delim.field_delim");
fieldDictPath = config.getString("model.field_dict_path");
randomParams = new RandomParams(config, "");
LOG_UTILS.importantInfo("K:" + Arrays.toString(K));
//LOG_UTILS.importantInfo("seed:" + seed);
LOG_UTILS.importantInfo("random:" + randomParams);
LOG_UTILS.importantInfo("bias_need_latent_factor:" + biasNeedLatentFactor);
LOG_UTILS.importantInfo("need_first_order:" + needFirstOrder + ", need_second_order:" + needSecondOrder);
LOG_UTILS.importantInfo("field_delim:" + fieldDelim + ", field_dict_path:" + fieldDictPath);
}
示例2: FMModelDataFlow
import com.typesafe.config.Config; //导入方法依赖的package包/类
public FMModelDataFlow(IFileSystem fs,
Config config,
ThreadCommSlave comm,
int threadNum,
boolean needPyTransform,
String pyTransformScript) throws Exception {
super(fs, config,
comm,
threadNum,
needPyTransform,
pyTransformScript);
List<Integer> klist = config.getIntList("k");
K = new int[klist.size()];
for (int i = 0; i < klist.size(); i++) {
K[i] = klist.get(i);
}
//seed = config.getInt("seed");
randomParams = new RandomParams(config, "");
biasNeedLatentFactor = config.getBoolean("bias_need_latent_factor");
needFirstOrder = (K[0] >= 1);
needSecondOrder = (K[1] >= 1);
LOG_UTILS.importantInfo("K:" + Arrays.toString(K));
//comm.LOG_UTILS.importantInfo("seed:" + seed);
LOG_UTILS.importantInfo("random:" + randomParams);
LOG_UTILS.importantInfo("bias_need_latent_factor:" + biasNeedLatentFactor);
LOG_UTILS.importantInfo("need_first_order:" + needFirstOrder + ", need_second_order:" + needSecondOrder);
}
示例3: main
import com.typesafe.config.Config; //导入方法依赖的package包/类
public static void main(String[] args) {
// {{start:resource}}
Config defaultConfig = ConfigFactory.parseResources("defaults.conf");
// {{end:resource}}
// {{start:fallback}}
Config fallbackConfig = ConfigFactory.parseResources("overrides.conf")
.withFallback(defaultConfig)
.resolve();
// {{end:fallback}}
// {{start:text}}
log.info("name: {}", defaultConfig.getString("conf.name"));
log.info("name: {}", fallbackConfig.getString("conf.name"));
log.info("title: {}", defaultConfig.getString("conf.title"));
log.info("title: {}", fallbackConfig.getString("conf.title"));
// {{end:text}}
// {{start:resolved}}
log.info("combined: {}", fallbackConfig.getString("conf.combined"));
// {{end:resolved}}
// {{start:durations}}
log.info("redis.ttl minutes: {}", fallbackConfig.getDuration("redis.ttl", TimeUnit.MINUTES));
log.info("redis.ttl seconds: {}", fallbackConfig.getDuration("redis.ttl", TimeUnit.SECONDS));
// {{end:durations}}
// {{start:memorySize}}
// Any path in the configuration can be treated as a separate Config object.
Config uploadService = fallbackConfig.getConfig("uploadService");
log.info("maxChunkSize bytes: {}", uploadService.getMemorySize("maxChunkSize").toBytes());
log.info("maxFileSize bytes: {}", uploadService.getMemorySize("maxFileSize").toBytes());
// {{end:memorySize}}
// {{start:whitelist}}
List<Integer> whiteList = fallbackConfig.getIntList("conf.nested.whitelistIds");
log.info("whitelist: {}", whiteList);
List<String> whiteListStrings = fallbackConfig.getStringList("conf.nested.whitelistIds");
log.info("whitelist as Strings: {}", whiteListStrings);
// {{end:whitelist}}
// {{start:booleans}}
log.info("yes: {}", fallbackConfig.getBoolean("featureFlags.featureA"));
log.info("true: {}", fallbackConfig.getBoolean("featureFlags.featureB"));
// {{end:booleans}}
}