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

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

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

Config.getLongList介绍

暂无

代码示例

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

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

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

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

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

return config.getLongList(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: dremio/dremio-oss

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

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

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

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

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

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

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

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

/**
 * Returns a list of comma-delimited longs from the specified name.
 *
 * @param name
 * @return list of longs
 */
public List<Long> getLongs(String name) {
  if (!getConfig().hasPath(name)) {
    return Collections.emptyList();
  }
  List<Long> longs = getConfig().getLongList(name);
  return longs;
}

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

return config.getLongList(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);
  }
}

相关文章