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

com.cybermkd.common.util.Maper Maven / Gradle / Ivy

package com.cybermkd.common.util;

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

/**
 * Created by ice on 14-12-29.
 */
public class Maper {
    public static  Map of() {
        return new HashMap();
    }

    public static  Map of(final K k1, final V v1) {
        return new HashMap() {{
            put(k1, v1);
        }};
    }

    public static  Map of(final K k1, final V v1, final K k2, final V v2) {
        return new HashMap() {{
            put(k1, v1);
            put(k2, v2);
        }};
    }

    public static  Map of(final K k1, final V v1, final K k2, final V v2, final K k3, final V v3) {
        return new HashMap() {{
            put(k1, v1);
            put(k2, v2);
            put(k3, v3);
        }};
    }

    public static  Map of(final K k1, final V v1, final K k2, final V v2, final K k3, final V v3, final K k4, final V v4) {
        return new HashMap() {{
            put(k1, v1);
            put(k2, v2);
            put(k3, v3);
            put(k4, v4);
        }};
    }

    public static  Map of(final K k1, final V v1, final K k2, final V v2, final K k3, final V v3, final K k4, final V v4, final K k5, final V v5) {
        return new HashMap() {{
            put(k1, v1);
            put(k2, v2);
            put(k3, v3);
            put(k4, v4);
            put(k5, v5);
        }};
    }

    public static  Map copyOf(Map map) {
        return copyOf(new HashMap(), map);
    }

    public static  Map copyOf(Map dist, Map source) {
        dist.putAll(source);
        return dist;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy