Last active
December 30, 2015 02:09
-
-
Save sscovil/7760714 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String mapToString(Map<String, String> map, String kvSeparator, String setSeparator) { | |
StringBuilder stringBuilder = new StringBuilder(); | |
for (String key : map.keySet()) { | |
if (stringBuilder.length() > 0) stringBuilder.append(setSeparator); | |
String value = map.get(key); | |
stringBuilder.append((key != null ? key : "null")); | |
stringBuilder.append(kvSeparator); | |
stringBuilder.append(value != null ? value : "null"); | |
} | |
return stringBuilder.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment