The list of methods to do Map Copy are organized into topic(s).
Map
copy(final Map source)
Clones a map.
if (source == null) {
return null;
final Map<K, V> result = new HashMap<K, V>();
result.putAll(source);
return result;
void
copy(Map master, Map slave) copy
slave.clear();
Iterator itr = master.entrySet().iterator();
while (itr.hasNext()) {
Map.Entry entry = (Map.Entry) itr.next();
Object key = entry.getKey();
Object value = entry.getValue();
slave.put(key, value);
Map
copy(Map to, Map from, Object keys[]) copy
if (from == null || keys == null)
return to;
if (to == null)
to = new HashMap();
for (int i = 0; i < keys.length; i++)
to.put(keys[i], from.get(keys[i]));
return to;
Map,?>
copy(Map, ?> src, Map, ?> propertyRef) copy
Map<Object, Object> dst = new HashMap<Object, Object>();
Set<?> entrySet = src.entrySet();
for (Object object : entrySet) {
if (object != null && object instanceof Entry<?, ?>) {
Entry<?, ?> entry = (Entry<?, ?>) object;
Object key = entry.getKey();
Object value = entry.getValue();
if (key != null) {
...
Map
> copy(Map> original)
copy
Map<K, List<E>> copy = new HashMap<K, List<E>>();
for (Entry<K, List<E>> entry : original.entrySet()) {
copy.put(entry.getKey(), new ArrayList<E>(entry.getValue()));
return copy;
Map
copy(Map map)
copy
Map<K, V> copy = new HashMap<>();
for (K key : map.keySet()) {
copy.put(key, map.get(key));
return copy;
Map
> copy(Map> original)
copy
Map<String, Map<String, String>> copy = new HashMap<>();
if (original != null) {
for (String key : original.keySet()) {
copy.put(key, new HashMap<>(original.get(key)));
return copy;