java.util.LinkedHashMap.putAll()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(355)

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

LinkedHashMap.putAll介绍

暂无

代码示例

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

public Okv set(Map map) {
  super.putAll(map);
  return this;
}

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

public Okv set(Okv okv) {
  super.putAll(okv);
  return this;
}

代码示例来源:origin: jeasonlzy/okhttp-OkGo

public void put(HttpHeaders headers) {
  if (headers != null) {
    if (headers.headersMap != null && !headers.headersMap.isEmpty()) headersMap.putAll(headers.headersMap);
  }
}

代码示例来源:origin: jeasonlzy/okhttp-OkGo

public void put(HttpParams params) {
  if (params != null) {
    if (params.urlParamsMap != null && !params.urlParamsMap.isEmpty()) urlParamsMap.putAll(params.urlParamsMap);
    if (params.fileParamsMap != null && !params.fileParamsMap.isEmpty()) fileParamsMap.putAll(params.fileParamsMap);
  }
}

代码示例来源:origin: lipangit/JiaoZiVideoPlayer

public JZDataSource(LinkedHashMap urlsMap) {
  this.urlsMap.clear();
  this.urlsMap.putAll(urlsMap);
  currentUrlIndex = 0;
}

代码示例来源:origin: lipangit/JiaoZiVideoPlayer

public JZDataSource(LinkedHashMap urlsMap, String title) {
  this.urlsMap.clear();
  this.urlsMap.putAll(urlsMap);
  this.title = title;
  currentUrlIndex = 0;
}

代码示例来源:origin: graphql-java/graphql-java

public Map<String, ScalarTypeDefinition> scalars() {
  LinkedHashMap<String, ScalarTypeDefinition> scalars = new LinkedHashMap<>(ScalarInfo.STANDARD_SCALAR_DEFINITIONS);
  scalars.putAll(scalarTypes);
  return scalars;
}

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

public void addAggregationExprsForClause(String clause,
  LinkedHashMap<String, ASTNode> aggregationTrees) {
 if (destToAggregationExprs.containsKey(clause)) {
  destToAggregationExprs.get(clause).putAll(aggregationTrees);
 } else {
  destToAggregationExprs.put(clause, aggregationTrees);
 }
}

代码示例来源:origin: google/guava

@VisibleForTesting
static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) {
 LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap();
 // Search parent first, since it's the order ClassLoader#loadClass() uses.
 ClassLoader parent = classloader.getParent();
 if (parent != null) {
  entries.putAll(getClassPathEntries(parent));
 }
 for (URL url : getClassLoaderUrls(classloader)) {
  if (url.getProtocol().equals("file")) {
   File file = toFile(url);
   if (!entries.containsKey(file)) {
    entries.put(file, classloader);
   }
  }
 }
 return ImmutableMap.copyOf(entries);
}

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

public RowResolver duplicate() {
 RowResolver resolver = new RowResolver();
 resolver.rowSchema = new RowSchema(rowSchema);
 resolver.rslvMap.putAll(rslvMap);
 resolver.invRslvMap.putAll(invRslvMap);
 resolver.altInvRslvMap.putAll(altInvRslvMap);
 resolver.expressionMap.putAll(expressionMap);
 resolver.isExprResolver = isExprResolver;
 resolver.ambiguousColumns.putAll(ambiguousColumns);
 resolver.checkForAmbiguity = checkForAmbiguity;
 return resolver;
}

代码示例来源:origin: Graylog2/graylog2-server

@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getChannelHandlers(MessageInput input) {
  final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlers = new LinkedHashMap<>(super.getChannelHandlers(input));
  handlers.put("traffic-counter", () -> throughputCounter);
  handlers.put("udp-datagram", () -> DatagramPacketHandler.INSTANCE);
  handlers.putAll(getChildChannelHandlers(input));
  return handlers;
}

代码示例来源:origin: Graylog2/graylog2-server

@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getCustomChildChannelHandlers(MessageInput input) {
  final LinkedHashMap<String, Callable<? extends ChannelHandler>> childChannelHandlers = new LinkedHashMap<>();
  childChannelHandlers.put("framer", () -> new LenientDelimiterBasedFrameDecoder(maxFrameLength, delimiter));
  childChannelHandlers.putAll(super.getCustomChildChannelHandlers(input));
  return childChannelHandlers;
}

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

static public Map<String, Object> getAllValues() {
  LinkedHashMap<String, Object> m = new LinkedHashMap<>();
  for (ServerMetrics metric : ServerMetrics.values()) {
    m.putAll(metric.getValues());
  }
  return m;
}

代码示例来源:origin: apache/incubator-druid

private void resolveWaitingFutures()
{
 final LinkedHashMap<CustomSettableFuture, Counter> waitingFuturesCopy = new LinkedHashMap<>();
 synchronized (waitingFutures) {
  waitingFuturesCopy.putAll(waitingFutures);
  waitingFutures.clear();
 }
 for (Map.Entry<CustomSettableFuture, Counter> e : waitingFuturesCopy.entrySet()) {
  try {
   e.getKey().set(getRequestsSinceWithoutWait(e.getValue()));
  }
  catch (Exception ex) {
   e.getKey().setException(ex);
  }
 }
}

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

public void replaceAllEntriesInCacheWith(List<GoDashboardPipeline> newPipelinesToCache) {
  cache.clear();
  cache.putAll(createMapFor(newPipelinesToCache));
  cacheHasChanged();
}

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

void replaceAllEntriesInCacheWith(List<ProjectStatus> projectStatuses) {
  this.cache.clear();
  this.cache.putAll(createReplacementItems(projectStatuses));
  cacheHasChanged();
}

代码示例来源:origin: google/j2objc

@VisibleForTesting
static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) {
 LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap();
 // Search parent first, since it's the order ClassLoader#loadClass() uses.
 ClassLoader parent = classloader.getParent();
 if (parent != null) {
  entries.putAll(getClassPathEntries(parent));
 }
 for (URL url : getClassLoaderUrls(classloader)) {
  if (url.getProtocol().equals("file")) {
   File file = toFile(url);
   if (!entries.containsKey(file)) {
    entries.put(file, classloader);
   }
  }
 }
 return ImmutableMap.copyOf(entries);
}

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

Many(final Credential c1, final Many subsequent) {
  LinkedHashMap<Key, Credential> map = new LinkedHashMap<>(subsequent.map.size() + 1);
  map.put(Key.of(c1), c1);
  map.putAll(subsequent.map);
  this.map = map;
  int hc = 0;
  for (Credential credential : map.values()) {
    hc ^= typeHash(credential);
  }
  hashCode = hc;
  assert size() > 2;
}

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

public void putAll(List<ProjectStatus> statuses) {
  cache.putAll(createReplacementItems(statuses));
  cacheHasChanged();
}

代码示例来源:origin: prestodb/presto

@VisibleForTesting
static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) {
 LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap();
 // Search parent first, since it's the order ClassLoader#loadClass() uses.
 ClassLoader parent = classloader.getParent();
 if (parent != null) {
  entries.putAll(getClassPathEntries(parent));
 }
 for (URL url : getClassLoaderUrls(classloader)) {
  if (url.getProtocol().equals("file")) {
   File file = toFile(url);
   if (!entries.containsKey(file)) {
    entries.put(file, classloader);
   }
  }
 }
 return ImmutableMap.copyOf(entries);
}

相关文章