Here you can find the source of putDeepValue(Map
public static <T> void putDeepValue(Map<String, T> map, String keyPath, T v)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; public class Main { public static <T> void putDeepValue(Map<String, T> map, String keyPath, T v) { HashMap subMap = (HashMap) map; String[] propertyPath = keyPath.toString().split("\\."); int j = 0; for (; j < propertyPath.length - 1; j++) { String property = propertyPath[j]; Object value = subMap.get(property); if ((value == null) || !(value instanceof Map)) { value = new HashMap<>(); subMap.put(property, value); }/*from w w w . j a v a 2 s . c o m*/ subMap = (HashMap) value; } subMap.put(propertyPath[j], v); } }