@Test public void toArrayWithEscaped() throws Exception { assertArrayEquals(CollectionUtilities.toArrayWithEscaped("a,b,c,d", ","), new String[]{"a", "b", "c", "d"}); assertArrayEquals(CollectionUtilities.toArrayWithEscaped("a\\,b\\,c\\,d", ","), new String[]{"a\\", "b\\", "c\\", "d"}); assertArrayEquals(CollectionUtilities.toArrayWithEscaped(null, ","), new String[0]); }
@NotNull public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) { if (StringUtils.isEmpty(stringArray)) { return new String[0]; } return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter); }
CollectionUtilities { @NotNull public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) { if (StringUtils.isEmpty(stringArray)) { return new String[0]; } return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter); } }
CollectionUtilities { @NotNull public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) { if (StringUtils.isEmpty(stringArray)) { return new String[0]; } return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter); } private  CollectionUtilities(); }
CollectionUtilities { @NotNull public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) { if (StringUtils.isEmpty(stringArray)) { return new String[0]; } return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter); } private  CollectionUtilities(); @NotNull static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter); @NotNull static String[] toArray(@Nullable final String stringArray, @NotNull final String delimiter); @NotNull static List<String> toListWithEscaped(@Nullable final String stringList, @NotNull final String delimiter); @NotNull static List<String> toList(@Nullable final String stringList, @NotNull final String delimiter); @NotNull static Map<String, String> toMap(@Nullable final String stringMap, @NotNull final String pairDelimiter, @NotNull final String keyValueDelimiter); }
CollectionUtilities { @NotNull public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) { if (StringUtils.isEmpty(stringArray)) { return new String[0]; } return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter); } private  CollectionUtilities(); @NotNull static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter); @NotNull static String[] toArray(@Nullable final String stringArray, @NotNull final String delimiter); @NotNull static List<String> toListWithEscaped(@Nullable final String stringList, @NotNull final String delimiter); @NotNull static List<String> toList(@Nullable final String stringList, @NotNull final String delimiter); @NotNull static Map<String, String> toMap(@Nullable final String stringMap, @NotNull final String pairDelimiter, @NotNull final String keyValueDelimiter);  }