Java Map Clone cloneMap(Map map)

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

Description

Creates a duplicate of the specified map

License

Open Source License

Declaration

public static <K, V> Map<K, V> cloneMap(Map<K, V> map) 

Method Source Code


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

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

public class Main {
    /** Creates a duplicate of the specified map */
    public static <K, V> Map<K, V> cloneMap(Map<K, V> map) {
        Map<K, V> tempUpdates = new HashMap<K, V>();
        tempUpdates.putAll(map);/*from w w  w .  j av  a 2  s.c  o  m*/

        return tempUpdates;
    }
}

Related

  1. clone(Map map1)
  2. clone(Map origMap)
  3. clone(Map map)
  4. cloneDefaults(Map defaults)
  5. cloneMap(final Map m)
  6. cloneMap(Map orig)
  7. cloneMap(Map> map)