Java Map Put putIfAbsent(final Map from, final Map to)

Here you can find the source of putIfAbsent(final Map from, final Map to)

Description

put If Absent

License

Apache License

Declaration

public static <K, V> void putIfAbsent(final Map<K, V> from, final Map<K, V> to) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    public static <K, V> void putIfAbsent(final Map<K, V> from, final Map<K, V> to) {
        for (Map.Entry<K, V> entry : from.entrySet()) {
            to.putIfAbsent(entry.getKey(), entry.getValue());
        }/*from   w  ww.j ava2  s. c  o m*/
    }
}

Related

  1. putCheckedObjectInInnerMap(Map> mapValues, A key, K innerKey, V obj)
  2. putClassToMap(String extensionId, String key, Class className)
  3. putData(Map data, String name, Object value)
  4. putDataInToMap(String className, String MethodName)
  5. putDeepValue(Map map, String keyPath, T v)
  6. putIfAbsent(Map from, Map to)
  7. putIfAbsent(Map map, K key, V value)
  8. putIfAbsent(Map map, K key, V value)
  9. putIfAbsent(Map map, K key, V value)