All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sigopt.net.MapHelper Maven / Gradle / Ivy

There is a newer version: 6.3.0
Show newest version
package com.sigopt.net;

import java.util.HashMap;
import java.util.Map;

class MapHelper {
    // toMerge will overwrite map values.
    public static  Map merge(Map map, Map toMerge) {
        Map ret = new HashMap();
        ret.putAll(ensure(map));
        ret.putAll(ensure(toMerge));
        return ret;
    }

    public static  Map ensure(Map map) {
        if(map == null) {
            return new HashMap();
        }
        return map;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy