List of utility methods to do Collection Convert
TreeSet | toTreeSet(Collection to Tree Set final TreeSet<T> treeSet = new TreeSet<T>(comparator); for (T t : collection) { treeSet.add(t); return treeSet; |
AnyCollection | toUnmodifiableCollection( AnyCollection collection) Transforms the collection to an unmodifiable one, if there is any implementation in the Java Collections utilities. if (collection == null) { return null; if (collection instanceof List<?>) { return (AnyCollection) Collections.unmodifiableList((List<?>) collection); if (collection instanceof NavigableSet<?>) { return (AnyCollection) Collections.unmodifiableNavigableSet((NavigableSet<?>) collection); ... |
Collection | trimCollection(Collection trim Collection Collection convertCaseValues = new ArrayList<String>(collectionToBeConverted.size()); for (Iterator<String> iterator = collectionToBeConverted.iterator(); iterator.hasNext();) { String s = iterator.next(); convertCaseValues.add(s.trim()); return convertCaseValues; |