Java Map Merge merge(Map options, Map addition)

Here you can find the source of merge(Map options, Map addition)

Description

merge

License

Open Source License

Declaration

public static void merge(Map options, Map addition) 

Method Source Code

//package com.java2s;
/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
 * This code is licensed under the GPL 2.0 license, availible at the root
 * application directory./* w  w  w.j  a  va  2  s  .  com*/
 */

import java.util.Map;

public class Main {
    public static void merge(Map options, Map addition) {
        for (Object o : addition.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            if (entry.getValue() == null)
                options.remove(entry.getKey());
            else
                options.put(entry.getKey(), entry.getValue());
        }
    }
}

Related

  1. merge(final Map map1, final Map map2)
  2. merge(final Map... maps)
  3. merge(final Map> targetContext, final Map> newContext)
  4. merge(List> list)
  5. merge(Map map1, Map map2)
  6. merge(Map into, Map with)
  7. merge(Map left, Map right)
  8. merge(Map map, K key, V value)
  9. merge(Map map, Map... maps)