Here you can find the source of putAll(Map
Parameter | Description |
---|---|
map | The map in which to put data. |
otherMap | The map to merge in the first map (may be null). |
K | Type of keys. |
V | Type of values. |
public static <K, V> void putAll(Map<K, V> map, Map<K, V> otherMap)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { /**//from w ww .j ava2s . c om * Map.putall with non null check on the other map. * * @param map The map in which to put data. * @param otherMap The map to merge in the first map (may be null). * @param <K> Type of keys. * @param <V> Type of values. */ public static <K, V> void putAll(Map<K, V> map, Map<K, V> otherMap) { if (otherMap != null) { map.putAll(otherMap); } } }