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

in.ashwanthkumar.utils.collections.Maps Maven / Gradle / Ivy

There is a newer version: 0.1.0
Show newest version
package in.ashwanthkumar.utils.collections;

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

public class Maps {
    public static  Map of(K key, V value) {
        HashMap map = new HashMap();
        map.put(key, value);
        return map;
    }

    public static class MapBuilder {
        private Map internalMap = new HashMap();

        private MapBuilder() {}

        public MapBuilder put(K key, V value) {
            internalMap.put(key, value);
            return this;
        }
        public Map value() {
            return internalMap;
        }
    }
    public static  MapBuilder builder() {
        return new MapBuilder();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy