Java Map Create buildMap(String... keysAndValues)

Here you can find the source of buildMap(String... keysAndValues)

Description

build Map

License

Open Source License

Declaration

public static Map<String, String> buildMap(String... keysAndValues) 

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 Map<String, String> buildMap(String... keysAndValues) {
        Map<String, String> map = new HashMap<String, String>();
        for (int i = 0; i < keysAndValues.length;) {
            map.put(keysAndValues[i], keysAndValues[i + 1]);
            i += 2;// ww w  . j  a va2 s  .c  om
        }
        return map;
    }
}

Related

  1. buildMap(K key, V value)
  2. buildMap(K key1, V value1)
  3. buildMap(List a, Map coeffs)
  4. buildMap(Object key, Object value)
  5. buildMap(Object... data)
  6. buildMap(String... keyValuePairs)
  7. createMap()
  8. createMap()
  9. createMap()