Java Map Put putAbsent(Map dest, Map src)

Here you can find the source of putAbsent(Map dest, Map src)

Description

put Absent

License

Open Source License

Declaration

public static <K, V> void putAbsent(Map<K, V> dest, Map<K, V> src) 

Method Source Code

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

import java.util.Map;

public class Main {
    public static <K, V> void putAbsent(Map<K, V> dest, Map<K, V> src) {
        for (Map.Entry<K, V> entry : src.entrySet()) {
            if (!dest.containsKey(entry.getKey())) {
                dest.put(entry.getKey(), entry.getValue());
            }/* w ww. jav a2s  .  c o  m*/
        }
    }
}

Related

  1. put(Map map, K key, V value)
  2. put(Map map, String key, Object value)
  3. put(Map structure, String name, Object object)
  4. put(ThreadLocal> threadLocal, Object key, String value)
  5. put2DayOfWeekMaps(int pDayOfWeek, String pDayName)
  6. putAll(final Map dst, final Map src)
  7. putAll(M map, Iterable> values)
  8. putAll(Map original, Map... others)
  9. putAll(Map dest, Collection src, V value)