Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/106#discussion_r60430130
--- Diff:
utils/common/src/main/java/org/apache/brooklyn/util/text/Strings.java ---
@@ -916,4 +916,17 @@ public static String toUniqueString(Object x, int
optionalMax) {
return maxlenWithEllipsis(xs,
optionalMax-8)+"/"+Integer.toHexString(xs.hashCode());
}
+
+ /**
+ * Parses a string as comma separated values and returns a list of the
entries with whitespace removed.
+ * @param csv
+ * @param separators
+ */
+ public static List<String> parseCsv(String csv, String separators) {
+ List<String> result = MutableList.of();
+ for (String value: csv.split(separators)) {
+ result.add(value.trim());
--- End diff --
Suggest adding some tests for this method. `.split` will return non-empty
array for the empty string I believe
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---