List of utility methods to do Map Copy
Map | copy(final Map 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 dest, Map src) copy for (Object k : src.keySet()) {
Object v = src.get(k);
dest.put(k, v);
|
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 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 copy Map<K, V> copy = new HashMap<>(); for (K key : map.keySet()) { copy.put(key, map.get(key)); return copy; |
void | copy(Map copy copy.clear(); merge(master, copy); |
Map | copy(Map 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; |
void | copy(Map copy for (Entry<T, K> e : src.entrySet()) {
dst.put(e.getKey(), e.getValue());
|