com.beust.jcommander.internal.Maps.newHashMap()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(167)

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

Maps.newHashMap介绍

暂无

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

/** This converts everything to Strings and back, but it does work, and avoids a bunch of type conditionals. */
public T scrape(JsonNode rootNode) {
  Map<String, String> pairs = Maps.newHashMap();
  // Ugh, there has to be a better way to do this.
  Iterator<Map.Entry<String, JsonNode>> fieldIterator = rootNode.fields();
  while (fieldIterator.hasNext()) {
    Map.Entry<String, JsonNode> field = fieldIterator.next();
    pairs.put(field.getKey(), field.getValue().asText());
  }
  return scrape(pairs);
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

LOG.info("Generating unique names for stop patterns on each route.");
Set<String> usedRouteNames = Sets.newHashSet();
Map<Route, String> uniqueRouteNames = Maps.newHashMap();

代码示例来源:origin: opentripplanner/OpenTripPlanner

Map<Integer, Geometry> contours = Maps.newHashMap();
for (Integer threshold : bufferLists.keys()) {
  Collection<Geometry> buffers = bufferLists.get(threshold);

代码示例来源:origin: opentripplanner/OpenTripPlanner

router.route();
result = router.timeSurfaceRangeSet;
Map<String, Integer> idForSurface = Maps.newHashMap();
idForSurface.put("min", surfaceCache.add(result.min)); // requires analyst mode turned on
idForSurface.put("avg", surfaceCache.add(result.avg));

代码示例来源:origin: opentripplanner/OpenTripPlanner

Map<TripTimes, TripPattern> patternForTripTimes = Maps.newHashMap();

代码示例来源:origin: opentripplanner/OpenTripPlanner

Map<TripPattern, LineString[]> geometriesByTripPattern = Maps.newHashMap();

代码示例来源:origin: com.beust/jcommander

public static <T> Map<T, T> newHashMap(T... parameters) {
 Map<T, T> result = Maps.newHashMap();
 for (int i = 0; i < parameters.length; i += 2) {
  result.put(parameters[i], parameters[i + 1]);
 }
 return result;
}

代码示例来源:origin: com.beust/jcommander

/**
 * Create the ParameterDescriptions for all the \@Parameter found.
 */
private void createDescriptions() {
  descriptions = Maps.newHashMap();
  for (Object object : objects) {
    addDescription(object);
  }
}

代码示例来源:origin: com.beust/jcommander

private static <V> V findAbbreviatedValue(Map<? extends IKey, V> map, IKey name,
  boolean caseSensitive) {
 String string = name.getName();
 Map<String, V> results = Maps.newHashMap();
 for (IKey c : map.keySet()) {
  String n = c.getName();
  boolean match = (caseSensitive && n.startsWith(string))
    || ((! caseSensitive) && n.toLowerCase().startsWith(string.toLowerCase()));
  if (match) {
   results.put(n, map.get(c));
  }
 }
 V result;
 if (results.size() > 1) {
  throw new ParameterException("Ambiguous option: " + name
    + " matches " + results.keySet());
 } else if (results.size() == 1) {
  result = results.values().iterator().next();
 } else {
  result = null;
 }
 return result;
}

代码示例来源:origin: org.jboss.pressgang.ccms/jcommander-pressgang

public static <T> Map<T, T> newHashMap(T... parameters) {
 Map<T, T> result = Maps.newHashMap();
 for (int i = 0; i < parameters.length; i += 2) {
  result.put(parameters[i], parameters[i + 1]);
 }
 return result;
}

代码示例来源:origin: Slowpoke101/FTBLaunch

public Map<String,SlimVersion> getVersionMap() {
  if(versionMap == null) {
    versionMap = Maps.newHashMap();
    for (SlimVersion version : versions)
    {
      versionMap.put(version.getId(), version);
    }
  }
  return versionMap;
}
public SlimVersion getVersionByName(String name){

代码示例来源:origin: io.macgyver/macgyver-core

@Override
public final Map<String, String> apply(Map<String, String> t) {
  Map<String,String> m = Maps.newHashMap();
  m.putAll(t);
  applyConfig(t);
  return t;
}

代码示例来源:origin: Slowpoke101/FTBLaunch

public SlimVersion getVersionByName(String name){
    if(versionMap == null) {
      versionMap = Maps.newHashMap();
      for (SlimVersion version : versions)
      {
        versionMap.put(version.getId(), version);
      }
    }
    return versionMap.get(name);
  }
}

代码示例来源:origin: net.thucydides.plugins.jira/thucydides-jira-plugin

private Map<String, String> renderedFieldValuesFrom(JSONObject renderedFields) throws JSONException {
  Map<String,String> renderedFieldMap = Maps.newHashMap();
  for(Object key : Lists.newArrayList(renderedFields.sortedKeys())) {
    String fieldName = (String) key;
    String renderedValue = renderedFields.getString(fieldName);
    if (getCustomFieldNameIndex().containsKey(fieldName)) {
      fieldName = getCustomFieldNameIndex().get(key);
    }
    renderedFieldMap.put(fieldName, renderedValue);
  }
  return renderedFieldMap;
}

代码示例来源:origin: net.serenity-bdd/serenity-jira-plugin

private Map<String, CustomField> indexCustomFields()  {
  Map<String, CustomField> index = Maps.newHashMap();
  for(CustomField field : getExistingCustomFields()) {
    index.put(field.getName(), field);
  }
  return index;
}

代码示例来源:origin: net.thucydides.plugins.jira/thucydides-jira-plugin

private Map<String, CustomField> indexCustomFields() throws JSONException {
  Map<String, CustomField> index = Maps.newHashMap();
  for(CustomField field : getExistingCustomFields()) {
    index.put(field.getName(), field);
  }
  return index;
}

代码示例来源:origin: net.thucydides.plugins.jira/thucydides-jira-plugin

private Map<String, Object> customFieldValuesIn(JSONObject fields, JSONObject renderedFields) throws JSONException {
  Map<String, Object> customFieldValues = Maps.newHashMap();
  for (String customFieldName : customFields) {
    CustomField customField = getCustomFieldsIndex().get(customFieldName);
    if (customFieldDefined(fields, renderedFields, customField)) {
      Object customFieldValue = readFieldValue(fields, customField);
      customFieldValues.put(customFieldName, customFieldValue);
    }
  }
  return customFieldValues;
}

代码示例来源:origin: net.serenity-bdd/serenity-jira-plugin

private Map<String, Object> customFieldValuesIn(JsonObject fields, JsonObject renderedFields)  {
  Map<String, Object> customFieldValues = Maps.newHashMap();
  for (String customFieldName : customFields) {
    CustomField customField = getCustomFieldsIndex().get(customFieldName);
    if (customFieldDefined(fields, renderedFields, customField)) {
      Object customFieldValue = readFieldValue(fields, customField);
      customFieldValues.put(customFieldName, customFieldValue);
    }
  }
  return customFieldValues;
}

代码示例来源:origin: net.thucydides.plugins.jira/thucydides-jira-plugin

private Map<String, String> indexCustomFieldNames() throws JSONException {
  Map<String, String> index = Maps.newHashMap();
  for(CustomField field : getExistingCustomFields()) {
    index.put(field.getId(), field.getName());
  }
  return index;
}

代码示例来源:origin: net.serenity-bdd/serenity-jira-plugin

private Map<String, String> indexCustomFieldNames()  {
  Map<String, String> index = Maps.newHashMap();
  for(CustomField field : getExistingCustomFields()) {
    index.put(field.getId(), field.getName());
  }
  return index;
}

相关文章