Tabnine Logo
Map.putAll
Code IndexAdd Tabnine to your IDE (free)

How to use
putAll
method
in
java.util.Map

Best Java code snippets using java.util.Map.putAll (Showing top 20 results out of 78,705)

Refine searchRefine arrow

  • Map.put
  • Map.Entry.getKey
  • Map.Entry.getValue
  • Map.get
  • Map.entrySet
origin: google/guava

@Override
public void putAll(Map<? extends K, ? extends V> map) {
 for (Entry<? extends K, ? extends V> entry : map.entrySet()) {
  checkArgument(apply(entry.getKey(), entry.getValue()));
 }
 unfiltered.putAll(map);
}
origin: google/guava

private void putAll(Iterable<Entry<K, V>> entries) {
 Map<K, V> map = new LinkedHashMap<>();
 for (Entry<K, V> entry : entries) {
  map.put(entry.getKey(), entry.getValue());
 }
 getMap().putAll(map);
}
origin: google/j2objc

@Override
public void putAll(Map<? extends K, ? extends V> map) {
 for (Entry<? extends K, ? extends V> entry : map.entrySet()) {
  checkArgument(apply(entry.getKey(), entry.getValue()));
 }
 unfiltered.putAll(map);
}
origin: stanfordnlp/CoreNLP

public TwoDimensionalMap(TwoDimensionalMap<K1, K2, V> tdm) {
 this(tdm.mf1, tdm.mf2);
 for (K1 k1 : tdm.map.keySet()) {
  Map<K2, V> m = tdm.map.get(k1);
  Map<K2, V> copy = mf2.newMap();
  copy.putAll(m);
  this.map.put(k1, copy);
 }
}
origin: spring-projects/spring-framework

@SuppressWarnings({"unchecked", "rawtypes"})
protected void visitMap(Map<?, ?> mapVal) {
  Map newContent = new LinkedHashMap();
  boolean entriesModified = false;
  for (Map.Entry entry : mapVal.entrySet()) {
    Object key = entry.getKey();
    int keyHash = (key != null ? key.hashCode() : 0);
    Object newKey = resolveValue(key);
    int newKeyHash = (newKey != null ? newKey.hashCode() : 0);
    Object val = entry.getValue();
    Object newVal = resolveValue(val);
    newContent.put(newKey, newVal);
    entriesModified = entriesModified || (newVal != val || newKey != key || newKeyHash != keyHash);
  }
  if (entriesModified) {
    mapVal.clear();
    mapVal.putAll(newContent);
  }
}
origin: apache/storm

/**
 * same as clojure's (merge-with merge m1 m2).
 */
private static Map mergeMaps(Map m1, Map m2) {
  if (m2 == null) {
    return m1;
  }
  for (Object o : m2.entrySet()) {
    Map.Entry entry = (Map.Entry) o;
    Object k = entry.getKey();
    Map existing = (Map) m1.get(k);
    if (existing == null) {
      m1.put(k, entry.getValue());
    } else {
      existing.putAll((Map) m2.get(k));
    }
  }
  return m1;
}
origin: ctripcorp/apollo

/**
 * 合并用户对namespace的修改
 */
private Map<String, String> mergeOverriddenProperties(String namespace, Map<String, String> configurations) {
 if (addedOrModifiedPropertiesOfNamespace.containsKey(namespace)) {
  configurations.putAll(addedOrModifiedPropertiesOfNamespace.get(namespace));
 }
 if (deletedKeysOfNamespace.containsKey(namespace)) {
  for (String k : deletedKeysOfNamespace.get(namespace)) {
   configurations.remove(k);
  }
 }
 return configurations;
}
origin: stanfordnlp/CoreNLP

public void updatePatterns(Map<String, Map<Integer, Set<E>>> tempPatsForSents) {
 for(Map.Entry<String, Map<Integer, Set<E>>> en :tempPatsForSents.entrySet()){
  Map<Integer, Set<E>> m = getPatternsForAllTokens(en.getKey());
  if(m == null)
   m = new HashMap<>();
  tempPatsForSents.get(en.getKey()).putAll(m);
 }
 this.addPatterns(tempPatsForSents);
 close();
}
origin: apache/usergrid

public <T> void mergeDataset( String property, Map<String, T> new_metadata ) {
  Object md = dynamic_properties.get( property );
  if ( !( md instanceof Map<?, ?> ) ) {
    md = new HashMap<String, T>();
    dynamic_properties.put( property, md );
  }
  @SuppressWarnings("unchecked") Map<String, T> metadata = ( Map<String, T> ) md;
  metadata.putAll( new_metadata );
}
origin: stanfordnlp/CoreNLP

public ConstantsAndVariables(Properties props, Map<String, Set<CandidatePhrase>> labelDictionary, Map<String, Class<? extends Key<String>>> answerClass, Map<String, Class> generalizeClasses,
               Map<String, Map<Class, Object>> ignoreClasses) throws IOException {
 //make the list unmodifiable!
 for(Entry<String, Set<CandidatePhrase>> en2: labelDictionary.entrySet()){
  seedLabelDictionary.put(en2.getKey(), Collections.unmodifiableSet(en2.getValue()));
 }
 this.labels = labelDictionary.keySet();
 this.answerClass = answerClass;
 this.generalizeClasses = generalizeClasses;
 if(this.generalizeClasses == null)
  this.generalizeClasses = new HashMap<>();
 this.generalizeClasses.putAll(answerClass);
 this.ignoreWordswithClassesDuringSelection = ignoreClasses;
 setUp(props);
}
origin: eirslett/frontend-maven-plugin

private Map<String, String> createEnvironment(List<String> paths, Platform platform, Map<String, String> additionalEnvironment) {
  final Map<String, String> environment = new HashMap<>(System.getenv());
  String pathVarName = "PATH";
  String pathVarValue = environment.get(pathVarName);
  if (platform.isWindows()) {
    for (Map.Entry<String, String> entry : environment.entrySet()) {
      if ("PATH".equalsIgnoreCase(entry.getKey())) {
        pathVarName = entry.getKey();
        pathVarValue = entry.getValue();
      }
    }
  }
  StringBuilder pathBuilder = new StringBuilder();
  if (pathVarValue != null) {
    pathBuilder.append(pathVarValue).append(File.pathSeparator);
  }
  for (String path : paths) {
    pathBuilder.insert(0, File.pathSeparator).insert(0, path);
  }
  environment.put(pathVarName, pathBuilder.toString());
  if (additionalEnvironment != null) {
    environment.putAll(additionalEnvironment);
  }
  return environment;
}
origin: spring-projects/spring-framework

/**
 * Merge a single hint into a map of hints, possibly creating and copying
 * all hints into a new map, or otherwise if the map of hints is empty,
 * creating a new single entry map.
 * @param hints a map of hints to be merge
 * @param hintName the hint name to merge
 * @param hintValue the hint value to merge
 * @return a single map with all hints
 */
public static Map<String, Object> merge(Map<String, Object> hints, String hintName, Object hintValue) {
  if (hints.isEmpty()) {
    return Collections.singletonMap(hintName, hintValue);
  }
  else {
    Map<String, Object> result = new HashMap<>(hints.size() + 1);
    result.putAll(hints);
    result.put(hintName, hintValue);
    return result;
  }
}
origin: apache/storm

/**
 * Invoked once immediately after construction
 *
 * @param storm_conf Storm configuration
 */
@Override
public void prepare(Map<String, Object> storm_conf) {
  Map<?, ?> params = (Map<?, ?>) storm_conf.get(Config.STORM_GROUP_MAPPING_SERVICE_PARAMS);
  Map<String, Set<String>> mapping = (Map<String, Set<String>>) params.get(STORM_FIXED_GROUP_MAPPING);
  if (mapping != null) {
    cachedGroups.putAll(mapping);
  } else {
    LOG.warn("There is no initial group mapping");
  }
}
origin: apache/incubator-dubbo

for (Map.Entry<String, String> entry : parameters.entrySet()) {
  String value = getParameters().get(entry.getKey());
  if (value == null) {
    if (entry.getValue() != null) {
      hasAndEqual = false;
      break;
    if (!value.equals(entry.getValue())) {
      hasAndEqual = false;
      break;
map.putAll(parameters);
return new URL(protocol, username, password, host, port, path, map);
origin: google/guava

static <T extends StandardTable<Object, Object, Object>> T populate(
  SerializationStreamReader reader, T table) throws SerializationException {
 Map<?, ?> hashMap = (Map<?, ?>) reader.readObject();
 for (Entry<?, ?> row : hashMap.entrySet()) {
  table.row(row.getKey()).putAll((Map<?, ?>) row.getValue());
 }
 return table;
}
origin: apache/zookeeper

  @Override
  public Map<String, Object> values() {
    Map<String, Object> m = new LinkedHashMap<>();
    for (Map.Entry<String, AvgMinMaxCounter> entry : counters.entrySet()) {
      m.putAll(entry.getValue().values());
    }
    return m;
  }
}
origin: alibaba/jstorm

public Topologies(Map<String, TopologyDetails> topologies) {
  if (topologies == null)
    topologies = new HashMap<>();
  this.topologies = new HashMap<>(topologies.size());
  this.topologies.putAll(topologies);
  this.nameToId = new HashMap<>(topologies.size());
  for (String topologyId : topologies.keySet()) {
    TopologyDetails topology = topologies.get(topologyId);
    this.nameToId.put(topology.getName(), topologyId);
  }
}
origin: SonarSource/sonarqube

private void loadInstances() {
 pluginInstancesByKeys.putAll(loader.load(pluginInfosByKeys));
 for (Map.Entry<String, Plugin> e : pluginInstancesByKeys.entrySet()) {
  keysByClassLoader.put(e.getValue().getClass().getClassLoader(), e.getKey());
 }
}
origin: SonarSource/sonarqube

/**
 * Only keep props that are not in parent
 */
private Map<String, String> collectModuleSpecificProps(DefaultInputModule module) {
 Map<String, String> moduleSpecificProps = new HashMap<>();
 AbstractProjectOrModule parent = hierarchy.parent(module);
 if (parent == null) {
  moduleSpecificProps.putAll(module.properties());
 } else {
  Map<String, String> parentProps = parent.properties();
  for (Map.Entry<String, String> entry : module.properties().entrySet()) {
   if (!parentProps.containsKey(entry.getKey()) || !parentProps.get(entry.getKey()).equals(entry.getValue())) {
    moduleSpecificProps.put(entry.getKey(), entry.getValue());
   }
  }
 }
 return moduleSpecificProps;
}
origin: apache/incubator-druid

private Map<String, Object> contextWithSqlId(Map<String, Object> queryContext)
{
 Map<String, Object> newContext = new HashMap<>();
 if (queryContext != null) {
  newContext.putAll(queryContext);
 }
 if (!newContext.containsKey(PlannerContext.CTX_SQL_QUERY_ID)) {
  newContext.put(PlannerContext.CTX_SQL_QUERY_ID, UUID.randomUUID().toString());
 }
 return newContext;
}
java.utilMapputAll

Javadoc

Copies every mapping in the specified Map to this Map.

Popular methods of Map

  • put
    Maps the specified key to the specified value.
  • get
  • entrySet
    Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes t
  • containsKey
    Returns whether this Map contains the specified key.
  • keySet
    Returns a set of the keys contained in this Map. The Set is backed by this Map so changes to one are
  • values
    Returns a Collection view of the values contained in this map. The collection is backed by the map,
  • remove
  • size
    Returns the number of mappings in this Map.
  • isEmpty
    Returns true if this map contains no key-value mappings.
  • clear
    Removes all elements from this Map, leaving it empty.
  • forEach
  • equals
    Compares the argument to the receiver, and returns true if the specified object is a Map and both Ma
  • forEach,
  • equals,
  • computeIfAbsent,
  • hashCode,
  • getOrDefault,
  • containsValue,
  • putIfAbsent,
  • compute,
  • merge

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now