Here you can find the source of stringToMap(final String s)
public static Map<String, String> stringToMap(final String s)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, String> stringToMap(final String s) { final Map<String, String> map = new HashMap<String, String>(); final String[] elements = s.split(";"); for (final String parts : elements) { final String[] keyValue = parts.split(":"); map.put(keyValue[0], keyValue[1]); }//from w ww. j ava 2 s . c o m return map; } }