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

com.moon.core.util.PropertiesHashMap Maven / Gradle / Ivy

package com.moon.core.util;

import java.util.Map;

import static com.moon.core.lang.StringUtil.stringify;

/**
 * @author moonsky
 */
public class PropertiesHashMap extends StringKeyHashMap {

    private static final long serialVersionUID = 362498820763181265L;

    public PropertiesHashMap(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); }

    public PropertiesHashMap(int initialCapacity) { super(initialCapacity); }

    public PropertiesHashMap() { }

    public PropertiesHashMap(Map m) { super(m); }

    public PropertiesHashMap(Map... maps) { super(maps); }

    public final static PropertiesHashMap fromObjectMap(Map map) {
        if (map == null) { return new PropertiesHashMap(); }
        PropertiesHashMap props = new PropertiesHashMap(map.size());
        map.forEach((key, value) -> props.put(stringify(key), stringify(value)));
        return props;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy