Here you can find the source of addToMap(String key, Map
public static void addToMap(String key, Map<String, Object> map, String value)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static void addToMap(String key, Map<String, Object> map, String value) { map.put(key, value);//from w w w . ja va 2 s. c o m } public static void addToMap(String key, Map<String, Object> map, int value) { map.put(key, Integer.toString(value)); } public static void addToMap(String key, Map<String, Object> map, boolean value) { map.put(key, Boolean.toString(value)); } }