List of utility methods to do Collection Convert
double[] | convert(Collection convert return convert(list.toArray(new Double[] {})); |
String[] | convert(Collection convert if (c == null) return null; String[] r = new String[c.size()]; int i = 0; for (String s : c) { r[i] = s; i++; return r; |
Collection | convert2IntegerCollection(String[] strs) convert Integer Collection Collection result = null; if (strs == null) { result = new ArrayList(0); } else { result = new ArrayList(strs.length); for (int i = 0; i < strs.length; i++) { result.add(new Integer(strs[i])); return result; |
Collection | convertArrayInCollection(String[] array) convert Array In Collection Collection coll = new ArrayList(); for (int i = 0; i < array.length; i++) { String role = array[i]; coll.add(role); return coll; |
char[] | convertCharCollectionToArray(Collection convert Char Collection To Array final char[] array = new char[chars.size()]; int i = 0; for (final Character c : chars) { array[i++] = c; return array; |
String[] | convertCollectionInArray(Collection coll) convert Collection In Array String[] array = new String[coll.size()]; int i = 0; for (Iterator iterator = coll.iterator(); iterator.hasNext();) { Object object = (Object) iterator.next(); String role = object.toString(); array[i] = role; i++; return array; |
String | convertCollectionStringToCSV(Collection convert Collection String To CSV StringBuffer sb = new StringBuffer(); int count = 1; for (String value : coll) { if (valueInSingleQuotes) { sb.append("'"); sb.append(value); if (valueInSingleQuotes) { ... |
C | convertCollectionType(Iterable> from, C newCollection, Class convert Collection Type for (Object item : from) { newCollection.add(listClass.cast(item)); return newCollection; |
Object | convertToCollection(Object source) convert To Collection if (source == null) { return null; if (source instanceof Collection) { return source; return Collections.singleton(source); |
String | convertToHqlParameters(Collection extends Number> numbers) convert To Hql Parameters StringBuilder hqlBuilder = new StringBuilder(); for (Number number : numbers) { if (hqlBuilder.length() > 0) { hqlBuilder.append(","); hqlBuilder.append(number); return hqlBuilder.toString(); ... |