List of utility methods to do Map Copy
Map | copyOptions(Map copy Options return options != null ? new HashMap<String, Object>(options) : new HashMap<String, Object>(); |
Map | copyParameters(Map copy Parameters Map<String, Object> ps = new HashMap<>(); if (parameters != null) ps.putAll(parameters); return ps; |
void | copyPropertiesToMap(Properties source, Map This function copies all mappings from source properties to target map. if (source != null) { Iterator<Entry<Object, Object>> iterator = source.entrySet().iterator(); Entry<Object, Object> entry = null; String key = null; String value = null; while (iterator.hasNext()) { entry = iterator.next(); key = (String) entry.getKey(); ... |
java.util.Map | copySafelyToObjectToObjectMap(java.util.Map, ?> map) copy Safely To Object To Object Map java.util.Map<Object, Object> castedCopy = new java.util.LinkedHashMap<Object, Object>(); if (map == null) { return castedCopy; java.util.Iterator<?> it = map.keySet().iterator(); while (it.hasNext()) { Object nextKey = it.next(); castedCopy.put(nextKey, map.get(nextKey)); ... |
Map | copyStringMap(Map copy String Map return new HashMap<String, String>(initParams); |
void | copyUntilFull(final Map extends T, ? extends U> source, final Map super T, ? super U> dest1, Map Copies the entries from source to dest1 until dest1 has reached size dest1Capacity .
for (final Map.Entry<? extends T, ? extends U> srcEntry : source.entrySet()) { if (dest1.size() < dest1Capacity) { dest1.put(srcEntry.getKey(), srcEntry.getValue()); } else { overflow.put(srcEntry.getKey(), srcEntry.getValue()); |
void | copyValue(Map Copy value. target.put(key, source.get(key)); |
boolean | copyValueIfExist(Map Copy value if it exists (is not null ) from the source map.
V v = source.get(sourceKey); if (v != null) { target.put(targetKey, v); return true; return false; |
boolean | copyValueIfExist(Map Copy value from the source map to the target map only if the value exists in the source map. V v = source.get(key); if (v != null) { target.put(key, v); return true; return false; |
Map | deepCopy(Map map) deep Copy Map result = new HashMap(); for (Object o : map.keySet()) { result.put(o, map.get(o)); result = Collections.unmodifiableMap(result); return result; |