Java Map from Array map(String... keyValues)

Here you can find the source of map(String... keyValues)

Description

map

License

LGPL

Declaration

public static final Map<String, String> map(String... keyValues) 

Method Source Code

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

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static final Map<String, String> map(String... keyValues) {
        HashMap<String, String> map = new HashMap<String, String>(
                keyValues.length / 2);/*from  www  . j a  v  a2 s  . co m*/
        for (int i = 0; i < keyValues.length;) {
            map.put(keyValues[i++], keyValues[i++]);
        }
        return map;
    }
}

Related

  1. map(String k, Object v)
  2. map(String key, String val)
  3. map(String... args)
  4. map(String... args)
  5. map(String... keysAndValues)
  6. map(String... strings)
  7. map(String... vals)
  8. map(T... input)
  9. toMap(Object... args)