Java Map Copy copyMap(Map from, Map to)

Here you can find the source of copyMap(Map from, Map to)

Description

copy Map

License

Apache License

Declaration

public static void copyMap(Map from, Map to) 

Method Source Code

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

import java.util.Map;

public class Main {
    public static void copyMap(Map from, Map to) {

        if (from == null || to == null)
            return;

        for (Object key : from.keySet()) {
            to.put(key, from.get(key));/* w w  w. jav  a2 s  .  c o m*/
        }
    }
}

Related

  1. copyDeep(Map> data)
  2. copyEntries(Map aSource, Map aTarget)
  3. copyExcludingKeys(Map map, Set excludedKeys)
  4. copyHashMap(HashMap map1, HashMap map2)
  5. copyLowerCaseMap(Map map)
  6. copyMap(Map sourceMap, Map targetMap)
  7. copyMap(Map m)
  8. copyMap(Map m)
  9. copyMap(Map oMap)