本文整理了Java中com.beust.jcommander.internal.Maps
类的一些代码示例,展示了Maps
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Maps
类的具体详情如下:
包路径:com.beust.jcommander.internal.Maps
类名称:Maps
暂无
代码示例来源: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: com.beust/jcommander
public Map<String, JCommander> getCommands() {
Map<String, JCommander> res = Maps.newLinkedHashMap();
for (Map.Entry<ProgramName, JCommander> entry : commands.entrySet()) {
res.put(entry.getKey().name, entry.getValue());
}
return res;
}
代码示例来源: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: org.jboss.pressgang.ccms/jcommander-pressgang
public Map<String, JCommander> getCommands() {
Map<String, JCommander> res = Maps.newLinkedHashMap();
for (Map.Entry<ProgramName, JCommander> entry : m_commands.entrySet()) {
res.put(entry.getKey().m_name, entry.getValue());
}
return res;
}
代码示例来源: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: springernature/omelet
public Map<AssertionError, IAssert> initialValue() {
return Maps.newHashMap();
}
};
代码示例来源:origin: com.shazam.fork/fork
public static Map<Pool, PoolProgressTracker> poolProgressTrackers() {
return newHashMap();
}
}
代码示例来源: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: 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: 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: org.jboss.pressgang.ccms/jcommander-pressgang
/**
* Create the ParameterDescriptions for all the \@Parameter found.
*/
private void createDescriptions() {
m_descriptions = Maps.newHashMap();
for (Object object : m_objects) {
addDescription(object);
}
}
代码示例来源:origin: apache/lens
@Override
public Map<String, Set<?>> getPartitions() {
return Maps.newHashMap();
}
});
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!