Java Map from Array map(Object... params)

Here you can find the source of map(Object... params)

Description

map

License

Open Source License

Declaration

public static <K, V> Map<K, V> map(Object... params) 

Method Source Code

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

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static <K, V> Map<K, V> map(Object... params) {
        HashMap map = new HashMap();
        for (int i = 0; i < params.length; i += 2) {
            map.put(params[i], params[i + 1]);
        }//  ww  w .  j  a v  a 2s  .  com
        return map;
    }
}

Related

  1. map(Object... objects)
  2. map(Object... objects)
  3. map(Object... objs)
  4. map(Object... objs)
  5. map(Object... oo)
  6. map(String k, Object v)
  7. map(String key, String val)
  8. map(String... args)
  9. map(String... args)