public static MutableMap<String, String> tokensToMap(
            String string,
            String pairSeparator,
            String keyValueSeparator)
    {
        MutableMap<String, String> map = UnifiedMap.newMap();
        for (StringTokenizer tokenizer = new StringTokenizer(string, pairSeparator); tokenizer.hasMoreTokens(); )
        {
            String token = tokenizer.nextToken();
            String key = token.substring(0, token.indexOf(keyValueSeparator));
            String value = token.substring(token.indexOf(keyValueSeparator) + 1, token.length());
            map.put(key, value);
        }
        return map;
    }
public static MutableMap < String , String > tokensToMap ( String string , String pairSeparator , String keyValueSeparator ) { MutableMap < String , String > map = UnifiedMap . newMap ( ) ; for ( StringTokenizer tokenizer = new StringTokenizer ( string , pairSeparator ) ; tokenizer . hasMoreTokens ( ) ; ) { String token = tokenizer . nextToken ( ) ; String key = token . substring ( 0 , token . indexOf ( keyValueSeparator ) ) ; String value = token . substring ( token . indexOf ( keyValueSeparator ) + 1 , token . length ( ) ) ; map . put ( key , value ) ; } return map ; }
Converts a string of tokens to a {@link MutableMap} using the specified separators.