@Test public void testStringToMap() throws Exception { }
public static void stringToMap(String str, Map<String, String> map) { if (isBlank(str)) { return; } String key = null; String value = null; int mark = -1; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); switch (c) { case StringUtils.AND_CHARACTER: value = str.substring(mark + 1, i); if (key != null) { map.put(unescapeEqualAndPercent(key), unescapeEqualAndPercent(value)); } key = null; mark = i; break; case StringUtils.EQUAL_CHARACTER: key = str.substring(mark + 1, i); mark = i; break; default: break; } } if (key != null) { int l = str.length() - mark - 1; value = l == 0 ? "" : str.substring(mark + 1); map.put(key, unescapeEqualAndPercent(value)); } }
StringUtils { public static void stringToMap(String str, Map<String, String> map) { if (isBlank(str)) { return; } String key = null; String value = null; int mark = -1; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); switch (c) { case StringUtils.AND_CHARACTER: value = str.substring(mark + 1, i); if (key != null) { map.put(unescapeEqualAndPercent(key), unescapeEqualAndPercent(value)); } key = null; mark = i; break; case StringUtils.EQUAL_CHARACTER: key = str.substring(mark + 1, i); mark = i; break; default: break; } } if (key != null) { int l = str.length() - mark - 1; value = l == 0 ? "" : str.substring(mark + 1); map.put(key, unescapeEqualAndPercent(value)); } } }
StringUtils { public static void stringToMap(String str, Map<String, String> map) { if (isBlank(str)) { return; } String key = null; String value = null; int mark = -1; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); switch (c) { case StringUtils.AND_CHARACTER: value = str.substring(mark + 1, i); if (key != null) { map.put(unescapeEqualAndPercent(key), unescapeEqualAndPercent(value)); } key = null; mark = i; break; case StringUtils.EQUAL_CHARACTER: key = str.substring(mark + 1, i); mark = i; break; default: break; } } if (key != null) { int l = str.length() - mark - 1; value = l == 0 ? "" : str.substring(mark + 1); map.put(key, unescapeEqualAndPercent(value)); } }  }
StringUtils { public static void stringToMap(String str, Map<String, String> map) { if (isBlank(str)) { return; } String key = null; String value = null; int mark = -1; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); switch (c) { case StringUtils.AND_CHARACTER: value = str.substring(mark + 1, i); if (key != null) { map.put(unescapeEqualAndPercent(key), unescapeEqualAndPercent(value)); } key = null; mark = i; break; case StringUtils.EQUAL_CHARACTER: key = str.substring(mark + 1, i); mark = i; break; default: break; } } if (key != null) { int l = str.length() - mark - 1; value = l == 0 ? "" : str.substring(mark + 1); map.put(key, unescapeEqualAndPercent(value)); } }  static boolean isBlank(String str); static boolean isNotBlank(String str); static String mapToStringWithPrefix(Map<String, String> map, String prefix); static String mapToString(Map<String, String> map); static void stringToMap(String str, Map<String, String> map); static String escapeComma(String str); static String unescapeComma(String str); static String arrayToString(Object[] items, char separator, String prefix, String postfix); static String escapePercentEqualAnd(String str); static String unescapeEqualAndPercent(String str); static boolean hasText(CharSequence str); static String cleanPath(String path); static String collectionToDelimitedString(Collection<?> coll, String delim); static String collectionToDelimitedString(Collection<?> coll, String delim,
                                                     String prefix, String suffix); static String[] delimitedListToStringArray(String str, String delimiter); static String[] delimitedListToStringArray(String str, String delimiter,
                                                      String charsToDelete); static String[] toStringArray(Collection<String> collection); static String deleteAny(String inString, String charsToDelete); static String replace(String inString, String oldPattern, String newPattern); static int countMatches(String str, char c); }
StringUtils { public static void stringToMap(String str, Map<String, String> map) { if (isBlank(str)) { return; } String key = null; String value = null; int mark = -1; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); switch (c) { case StringUtils.AND_CHARACTER: value = str.substring(mark + 1, i); if (key != null) { map.put(unescapeEqualAndPercent(key), unescapeEqualAndPercent(value)); } key = null; mark = i; break; case StringUtils.EQUAL_CHARACTER: key = str.substring(mark + 1, i); mark = i; break; default: break; } } if (key != null) { int l = str.length() - mark - 1; value = l == 0 ? "" : str.substring(mark + 1); map.put(key, unescapeEqualAndPercent(value)); } }  static boolean isBlank(String str); static boolean isNotBlank(String str); static String mapToStringWithPrefix(Map<String, String> map, String prefix); static String mapToString(Map<String, String> map); static void stringToMap(String str, Map<String, String> map); static String escapeComma(String str); static String unescapeComma(String str); static String arrayToString(Object[] items, char separator, String prefix, String postfix); static String escapePercentEqualAnd(String str); static String unescapeEqualAndPercent(String str); static boolean hasText(CharSequence str); static String cleanPath(String path); static String collectionToDelimitedString(Collection<?> coll, String delim); static String collectionToDelimitedString(Collection<?> coll, String delim,
                                                     String prefix, String suffix); static String[] delimitedListToStringArray(String str, String delimiter); static String[] delimitedListToStringArray(String str, String delimiter,
                                                      String charsToDelete); static String[] toStringArray(Collection<String> collection); static String deleteAny(String inString, String charsToDelete); static String replace(String inString, String oldPattern, String newPattern); static int countMatches(String str, char c); static final String NEWLINE; static final String EMPTY_STRING; static final String EQUAL; static final String AND; static final char EQUAL_CHARACTER; static final char AND_CHARACTER; static final String[] EMPTY_STRING_ARRAY; }