本文整理匯總了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}}
}