Java Map Put putAll(M map, Iterable> values)

Here you can find the source of putAll(M map, Iterable> values)

Description

Folds all the specified values into the supplied map and returns it.

License

Open Source License

Declaration

public static <K, V, M extends Map<K, V>> M putAll(M map,
        Iterable<? extends Map<? extends K, ? extends V>> values) 

Method Source Code

//package com.java2s;

import java.util.Map;

public class Main {
    /**//from ww w .  j  ava 2  s. c  o  m
     * Folds all the specified values into the supplied map and returns it.
     */
    public static <K, V, M extends Map<K, V>> M putAll(M map,
            Iterable<? extends Map<? extends K, ? extends V>> values) {
        for (Map<? extends K, ? extends V> val : values) {
            map.putAll(val);
        }
        return map;
    }
}

Related

  1. put(Map structure, String name, Object object)
  2. put(ThreadLocal> threadLocal, Object key, String value)
  3. put2DayOfWeekMaps(int pDayOfWeek, String pDayName)
  4. putAbsent(Map dest, Map src)
  5. putAll(final Map dst, final Map src)
  6. putAll(Map original, Map... others)
  7. putAll(Map dest, Collection src, V value)
  8. putAll(Map map, Map otherMap)
  9. putAll(Map map, Object... keysAndValues)