com.typesafe.config.Config.getIntList()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中com.typesafe.config.Config.getIntList()方法的一些代码示例,展示了Config.getIntList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getIntList()方法的具体详情如下:
包路径:com.typesafe.config.Config
类名称:Config
方法名:getIntList

Config.getIntList介绍

暂无

代码示例

代码示例来源:origin: kairosdb/kairosdb

@Override
  public List<?> extractListValue(Config config, String path) {
    return config.getIntList(path);
  }
},

代码示例来源:origin: apache/drill

@Override
public List<Integer> getIntList(String path) {
 return c.getIntList(path);
}

代码示例来源:origin: spotify/apollo

@Inject
MetricsConfig(Config config) {
 this.config = config;
 if (config.hasPath("metrics.server")) {
  enabledMetrics = parseConfig(config.getStringList("metrics.server"));
 } else {
  enabledMetrics = DEFAULT_ENABLED_METRICS;
 }
 if (config.hasPath("metrics.precreate-codes")) {
  precreateCodes = new HashSet<>(config.getIntList("metrics.precreate-codes"));
 } else {
  precreateCodes = Collections.emptySet();
 }
 durationThresholdConfig = DurationThresholdConfig.parseConfig(config);
}

代码示例来源:origin: atomix/atomix

return config.getIntList(configPropName);
} catch (ConfigException.WrongType e) {
 return config.getStringList(configPropName)

代码示例来源:origin: mpusher/mpush

private static Object getListValue(Class<?> beanClass, Type parameterType, Class<?> parameterClass, Config config, String configPropName) {
  Type elementType = ((ParameterizedType) parameterType).getActualTypeArguments()[0];
  if (elementType == Boolean.class) {
    return config.getBooleanList(configPropName);
  } else if (elementType == Integer.class) {
    return config.getIntList(configPropName);
  } else if (elementType == Double.class) {
    return config.getDoubleList(configPropName);
  } else if (elementType == Long.class) {
    return config.getLongList(configPropName);
  } else if (elementType == String.class) {
    return config.getStringList(configPropName);
  } else if (elementType == Duration.class) {
    return config.getDurationList(configPropName);
  } else if (elementType == ConfigMemorySize.class) {
    return config.getMemorySizeList(configPropName);
  } else if (elementType == Object.class) {
    return config.getAnyRefList(configPropName);
  } else if (elementType == Config.class) {
    return config.getConfigList(configPropName);
  } else if (elementType == ConfigObject.class) {
    return config.getObjectList(configPropName);
  } else if (elementType == ConfigValue.class) {
    return config.getList(configPropName);
  } else {
    throw new ConfigException.BadBean("Bean property '" + configPropName + "' of class " + beanClass.getName() + " has unsupported list element type " + elementType);
  }
}

代码示例来源:origin: racc/typesafeconfig-guice

@Override
  public List<?> extractListValue(Config config, String path) {
    return config.getIntList(path);
  }
},

代码示例来源:origin: dremio/dremio-oss

@Override
public List<Integer> getIntList(String path) {
 return config.getIntList(path);
}

代码示例来源:origin: org.apache.drill/drill-common

@Override
public List<Integer> getIntList(String path) {
 return c.getIntList(path);
}

代码示例来源:origin: com.github.ddth/ddth-commons-core

/**
 * Get a configuration as list of Integers. Return {@code null} if missing or wrong type.
 *
 * @param config
 * @param path
 * @return
 */
public static List<Integer> getIntegerList(Config config, String path) {
  try {
    return config.getIntList(path);
  } catch (ConfigException.Missing | ConfigException.WrongType e) {
    if (e instanceof ConfigException.WrongType) {
      LOGGER.warn(e.getMessage(), e);
    }
    return null;
  }
}

代码示例来源:origin: pranab/chombo

public NotMissingGroupValidator(String tag,Config validatorConfig) {
  super(tag);
  fieldGroups = new ArrayList<int[]>();
  
  List<? extends Config> groups = validatorConfig.getConfigList("fieldGroups");
  for(Config group : groups) {
    List<Integer> colOrdinals = group.getIntList("group");
    fieldGroups.add(BasicUtils.fromListToIntArray(colOrdinals));
  }
}

代码示例来源:origin: gitblit/fathom

/**
 * Returns a list of comma-delimited integers from the specified name.
 *
 * @param name
 * @return list of integers
 */
public List<Integer> getIntegers(String name) {
  if (!getConfig().hasPath(name)) {
    return Collections.emptyList();
  }
  List<Integer> ints = getConfig().getIntList(name);
  return ints;
}

代码示例来源:origin: pranab/chombo

/**
 * @param prAttr
 * @param config
 */
public FieldMergeTransformer(ProcessorAttribute prAttr, Config config) {
  super(prAttr.getTargetFieldOrdinals().length);
  config = getFieldSpecificConfig(prAttr.getOrdinal(), config);
  mergeFieldOrdinals  = config.getIntList("mergeFieldOrdinals");
  delimiter = config.getString("delimiter");
}

代码示例来源:origin: StubbornJava/StubbornJava

List<Integer> whiteList = fallbackConfig.getIntList("conf.nested.whitelistIds");
log.info("whitelist: {}", whiteList);
List<String> whiteListStrings = fallbackConfig.getStringList("conf.nested.whitelistIds");

代码示例来源:origin: io.atomix/atomix-utils

return config.getIntList(configPropName);
} catch (ConfigException.WrongType e) {
 return config.getStringList(configPropName)

代码示例来源:origin: com.github.mpusher/mpush-tools

private static Object getListValue(Class<?> beanClass, Type parameterType, Class<?> parameterClass, Config config, String configPropName) {
  Type elementType = ((ParameterizedType) parameterType).getActualTypeArguments()[0];
  if (elementType == Boolean.class) {
    return config.getBooleanList(configPropName);
  } else if (elementType == Integer.class) {
    return config.getIntList(configPropName);
  } else if (elementType == Double.class) {
    return config.getDoubleList(configPropName);
  } else if (elementType == Long.class) {
    return config.getLongList(configPropName);
  } else if (elementType == String.class) {
    return config.getStringList(configPropName);
  } else if (elementType == Duration.class) {
    return config.getDurationList(configPropName);
  } else if (elementType == ConfigMemorySize.class) {
    return config.getMemorySizeList(configPropName);
  } else if (elementType == Object.class) {
    return config.getAnyRefList(configPropName);
  } else if (elementType == Config.class) {
    return config.getConfigList(configPropName);
  } else if (elementType == ConfigObject.class) {
    return config.getObjectList(configPropName);
  } else if (elementType == ConfigValue.class) {
    return config.getList(configPropName);
  } else {
    throw new ConfigException.BadBean("Bean property '" + configPropName + "' of class " + beanClass.getName() + " has unsupported list element type " + elementType);
  }
}

代码示例来源:origin: eclipse/ditto

actorSystem.eventStream());
supportedSchemaVersions = config.getIntList(ConfigKeys.SCHEMA_VERSIONS);

相关文章