Java Map Put putAllIfNotNull(final Map map, final Map m)

Here you can find the source of putAllIfNotNull(final Map map, final Map m)

Description

put All If Not Null

License

Apache License

Declaration

public static <K, V> boolean putAllIfNotNull(final Map<? super K, ? super V> map,
            final Map<? extends K, ? extends V> m) 

Method Source Code

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

import java.util.Map;

public class Main {
    public static <K, V> boolean putAllIfNotNull(final Map<? super K, ? super V> map,
            final Map<? extends K, ? extends V> m) {
        if ((map == null) || (m == null)) {
            return false;
        }/* w  ww .  ja va2 s .c o m*/
        map.putAll(m);
        return true;
    }
}

Related

  1. putAll(Map map, Object... keysAndValues)
  2. putAll(Map model, String prefix, Map subModel)
  3. putAll(Map map, String prefix, Map values)
  4. putAllIfAbsent(final Map target, final Map source)
  5. putAllIfNew(Map dest, Map source)
  6. putAllNewInMap(Map original, Map newStuff)
  7. putAllNonNullValues(Map source, Map target)
  8. putAllObjects(Map targetMap, Map sourceMap)
  9. putAllRecursively(Map destination, Map source)