Java HashMap Create hashMap(Entry... entries)

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

Description

hash Map

License

Open Source License

Declaration

@SafeVarargs
    public static <K, V> Map<K, V> hashMap(Entry<K, V>... entries) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;

import java.util.Map;
import java.util.Map.Entry;

public class Main {
    @SafeVarargs
    public static <K, V> Map<K, V> hashMap(Entry<K, V>... entries) {
        Map<K, V> map = new HashMap<>();
        for (Entry<K, V> entry : entries) {
            map.put(entry.getKey(), entry.getValue());
        }// ww w  .  jav  a  2  s  . c o m
        return map;
    }
}

Related

  1. getHashMapFromMap( Map map, K key)
  2. hashMap()
  3. hashMap()
  4. hashmap()
  5. hashMap(Entry... entries)
  6. hashMap(Object... kvs)
  7. hashMapRange(int upTo)
  8. newHashMap( Map map)
  9. newHashMap()