Java Map Copy copy(Map map)

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

Description

copy

License

Open Source License

Declaration

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

Method Source Code

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

import java.util.*;

public class Main {
    public static <K, V> Map<K, V> copy(Map<K, V> map) {
        Map<K, V> copy = new HashMap<>();
        for (K key : map.keySet()) {
            copy.put(key, map.get(key));
        }//from www. j  ava  2s. c  o  m
        return copy;
    }
}

Related

  1. copy(Map dest, Map src)
  2. copy(Map master, Map slave)
  3. copy(Map to, Map from, Object keys[])
  4. copy(Map src, Map propertyRef)
  5. copy(Map> original)
  6. copy(Map master, Map copy)
  7. copy(Map> original)
  8. copy(Map src, Map dst)
  9. copyAndRemove(Map map, K key)