List of utility methods to do Collection Join
Collection | joinCollections(final Collection Join several all provided collections in the first one provided. The instance of the target collection is returned to ease use in foreach loops. if (target == null) { throw new IllegalArgumentException("Cannot join collection in null target"); if (collections.length == 0) { return target; for (final Collection<? extends T> collection : collections) { target.addAll(collection); ... |
String | joinCollectionToString(Collection join Collection To String StringBuffer sb = new StringBuffer(100); for (Object entity : list) { if (sb.length() > 0) { sb.append(str); sb.append(String.valueOf(entity)); return sb.toString(); ... |
String | joinCommaDelimitedList(Collection> list) Convert a Collection into a comma delimited String (i.e., CSV). if (list == null || list.isEmpty()) { return EMPTY; StringBuilder sb = new StringBuilder(); boolean first = true; for (Object o : list) { if (!first) { sb.append(", "); ... |
String | joinEmptyItemIncluded(Collection join Empty Item Included StringBuffer buffer = new StringBuffer(); if (stringCollection == null || stringCollection.isEmpty()) { return ""; Iterator iter = stringCollection.iterator(); while (iter.hasNext()) { String item = (String) iter.next(); if (item == null) ... |
String | joinList(@SuppressWarnings("rawtypes") Collection c) join List return joinList(c.toArray());
|
String | joinNullSafe(Collection join Null Safe if (null == collection || collection.isEmpty()) { return ""; if (null == separator) { separator = ""; final StringBuilder sb = new StringBuilder(); for (String str : collection) { ... |
String | joinObjects(Collection join Objects return joinObjects(objects, ""); |
String | joinQuoted(Collection Joins the given list into a string of quoted values joined with ", ". if (col.isEmpty()) return ""; StringBuilder sb = new StringBuilder(); for (String item : col) sb.append(",\"").append(item).append('"'); String str = sb.toString(); str = str.replaceFirst(",", ""); return str; ... |
String | joinSequence(Collection Joins the list of numbers as a dot-separated string. if (sequence == null) { return null; StringBuilder builder = new StringBuilder(); int i = 0; for (long l : sequence) { builder.append(l); i++; ... |
String | joinSort(Collection returns a string with elements of the given collection sorted and concatenated, separated by given separator if (c == null) return null; if (c.size() == 0) return ""; int n = c.size(), count = 0; StringBuilder result = new StringBuilder(); List<E> tmp = new ArrayList<E>(c); Collections.sort(tmp); ... |