Java Map Merge merge(final Map map1, final Map map2)

Here you can find the source of merge(final Map map1, final Map map2)

Description

merge

License

Apache License

Declaration

public static <K, V> Map<K, V> merge(final Map<K, V> map1, final Map<K, V> map2) 

Method Source Code

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

import java.util.HashMap;
import java.util.Map;

public class Main {
    public static <K, V> Map<K, V> merge(final Map<K, V> map1, final Map<K, V> map2) {
        final HashMap<K, V> ret = new HashMap<K, V>(map1);
        ret.putAll(map2);/*from   w  ww . ja  va  2 s .  c  om*/
        return ret;
    }
}

Related

  1. deepMerge(Map dst, Map src)
  2. deepMerge(Map m1, Map m2)
  3. deepMerge(Map original, Map newMap)
  4. merge(final Map lhs, final Map rhs)
  5. merge(final Map... maps)
  6. merge(final Map> targetContext, final Map> newContext)
  7. merge(List> list)
  8. merge(Map map1, Map map2)