Java Utililty Methods Array to Map

List of utility methods to do Array to Map

Description

The list of methods to do Array to Map are organized into topic(s).

Method

HashMaptoMap(T[][] pairs)
to Map
HashMap<T, T> map = new HashMap<>();
for (T[] pair : pairs) {
    map.put(pair[0], pair[1]);
return map;
HashMaptoMap(T[][] ts)
to Map
HashMap<T, T> out = new HashMap<T, T>(ts.length);
for (int i = 0; i < ts.length; i++)
    out.put(ts[i][0], ts[i][1]);
return out;