Java Map Create map(Map.Entry... entries)

Here you can find the source of map(Map.Entry... entries)

Description

map

License

Apache License

Declaration

public static <K, V> Map<K, V> map(Map.Entry<K, V>... entries) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static <K, V> Map<K, V> map(Map.Entry<K, V>... entries) {
        HashMap<K, V> resultMap = new HashMap<K, V>(entries.length);
        for (Map.Entry<K, V> mapEntry : entries) {
            resultMap.put(mapEntry.getKey(), mapEntry.getValue());
        }//w  w w.j a  v  a  2s .  c o  m
        return resultMap;
    }
}

Related

  1. map(K key1, V value1, Object... objects)
  2. map(K[] keys, V[] values)
  3. map(M map, K key, V value)
  4. map(Map map)
  5. map(Map map, Object key)
  6. map(Map.Entry... entries)
  7. map(Map accumulator, Key key, Value value)
  8. map(Map outcomeMapping, String line, int firstTabIdx)
  9. map(Object key, Object value)