Java Map Merge mergeMaps(Map m1, Map m2)

Here you can find the source of mergeMaps(Map m1, Map m2)

Description

merge Maps

License

Apache License

Declaration

private static <K, V> Map<K, V> mergeMaps(Map<K, V> m1, Map<K, V> m2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;

import java.util.Map;

public class Main {
    private static <K, V> Map<K, V> mergeMaps(Map<K, V> m1, Map<K, V> m2) {
        Map<K, V> m = new HashMap<>();
        if (m1 != null)
            m.putAll(m1);//from   ww  w  .  j  av  a2 s  . co  m
        if (m2 != null)
            m.putAll(m2);
        return m;
    }
}

Related

  1. mergeMapList(List> list)
  2. mergeMaps(Map m1, Map m2)
  3. mergeMaps(Map mainMap, Map defaultMap, String[] keys, boolean enforceValues)
  4. mergeMaps(Map dest, Map inserts)
  5. mergeMaps(Map into, Map from, boolean override)
  6. mergeMaps(Map map1, Map map2)
  7. mergeMaps(Map defaultMap, Map customMap)
  8. mergeMaps(Map destination, Map source)
  9. mergeMaps(Map map1, Map map2)