@Test public void testStringAsLongList() { List<Long> longs = StringHelper.getStringAsLongList("1,2,3,4,5,6,7,8"); Assert.assertEquals(longs.size(), 8); for (long i = 1; i <= 8; i++) { Assert.assertTrue(longs.contains(i)); } longs = StringHelper.getStringAsLongList("1,2,3,-4,5,6,-7,8,0", true); Assert.assertEquals(longs.size(), 6); for (long i = 0; i <= 8; i++) { if (i == 0 || i == 4 || i == 7) { Assert.assertFalse(longs.contains(i)); Assert.assertFalse(longs.contains(-1 * i)); } else { Assert.assertTrue(longs.contains(i)); } } }
public static List<Long> getStringAsLongList(String value) { return getStringAsLongList(value, false); }
StringHelper { public static List<Long> getStringAsLongList(String value) { return getStringAsLongList(value, false); } }
StringHelper { public static List<Long> getStringAsLongList(String value) { return getStringAsLongList(value, false); } private  StringHelper(); }
StringHelper { public static List<Long> getStringAsLongList(String value) { return getStringAsLongList(value, false); } private  StringHelper(); static String cleanString(String string); static List<String> cleanStringList(List<String> list); static String cleanUpString(String str, String cleanUpChar, String replaceChar); static Long getStringAsLong(String value, Long fallback); static Long[] getStringAsLongArray(String value); static Long[] getStringAsLongArray(String[] values); static List<Long> getStringAsLongList(String value); static List<Long> getStringAsLongList(String value, boolean ignoreValuesEqualLessZero); static List<Long> getStringAsLongList(String value, String separator); static List<Long> getStringAsLongList(String value, String separator,
            boolean ignoreValuesEqualLessZero); static List<Long> getStringAsLongList(String[] values); static Map<String, String> getStringAsMap(String mapping); static String replaceCharacter(String source, char charToReplace, String replacement); static String toString(Collection<?> coll); static String toString(Map<String, String> mapping); static String toString(Object[] array, String separator); static String truncateMiddle(String string, int maxLength, String ellipses); }
StringHelper { public static List<Long> getStringAsLongList(String value) { return getStringAsLongList(value, false); } private  StringHelper(); static String cleanString(String string); static List<String> cleanStringList(List<String> list); static String cleanUpString(String str, String cleanUpChar, String replaceChar); static Long getStringAsLong(String value, Long fallback); static Long[] getStringAsLongArray(String value); static Long[] getStringAsLongArray(String[] values); static List<Long> getStringAsLongList(String value); static List<Long> getStringAsLongList(String value, boolean ignoreValuesEqualLessZero); static List<Long> getStringAsLongList(String value, String separator); static List<Long> getStringAsLongList(String value, String separator,
            boolean ignoreValuesEqualLessZero); static List<Long> getStringAsLongList(String[] values); static Map<String, String> getStringAsMap(String mapping); static String replaceCharacter(String source, char charToReplace, String replacement); static String toString(Collection<?> coll); static String toString(Map<String, String> mapping); static String toString(Object[] array, String separator); static String truncateMiddle(String string, int maxLength, String ellipses);  }