Here you can find the source of arrayToMap(Map destMap, Object[]... oaaArray)
Parameter | Description |
---|---|
destMap | Keys and values are put into this map. |
oaaArray | Array of arrays containing the keys and values. |
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void arrayToMap(Map destMap, Object[]... oaaArray)
//package com.java2s; /**/*w w w .java 2 s .c o m*/ * (c) 2006 Cordys R&D B.V. All rights reserved. The computer program(s) is the * proprietary information of Cordys B.V. and provided under the relevant * License Agreement containing restrictions on use and disclosure. Use is * subject to the License Agreement. */ import java.util.Map; public class Main { /** * Converts the given array or key/value arrays to a map. * * <p>This version takes the destination map instead of creating a new one.</p> * * @param destMap Keys and values are put into this map. * @param oaaArray Array of arrays containing the keys and values. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static void arrayToMap(Map destMap, Object[]... oaaArray) { for (Object[] oaMapping : oaaArray) { destMap.put(oaMapping[0], oaMapping[1]); } } }