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

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

Description

map

License

Apache License

Declaration

public static Map map(Object... mapValues) 

Method Source Code

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

import java.util.*;

public class Main {
    public static Map map(Object... mapValues) {
        Map map = new HashMap();
        for (int i = 0; i < mapValues.length; i = i + 2) {
            map.put(mapValues[i], mapValues[i + 1]);
        }//from   w  w w .  ja v a2 s  .  co  m
        return map;
    }
}

Related

  1. map(Object... elements)
  2. map(Object... keyvals)
  3. map(Object... objects)
  4. map(Object... objects)
  5. map(Object... objects)
  6. map(Object... objs)