Java Map Copy deepCopy(Map map)

Here you can find the source of deepCopy(Map map)

Description

deep Copy

License

Open Source License

Declaration

public static Map deepCopy(Map map) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static Map deepCopy(Map map) {
        Map result = new HashMap();
        for (Object o : map.keySet()) {
            result.put(o, map.get(o));//  w w w . j av a2 s. co  m
        }
        result = Collections.unmodifiableMap(result);
        return result;
    }
}

Related

  1. copyStringMap(Map initParams)
  2. copyUntilFull(final Map source, final Map dest1, Map overflow, final int dest1Capacity)
  3. copyValue(Map source, Map target, K key)
  4. copyValueIfExist(Map source, K sourceKey, Map target, K targetKey)
  5. copyValueIfExist(Map source, Map target, K key)
  6. deepCopy(Map> context)
  7. deepCopyMap(Map map)