List of utility methods to do Array to Collection
Collection | arrayToCollection(Collection array To Collection for (T element : elements) { collection.add(element); return collection; |
C | arrayToCollection(E[] array, C collection) Constructs a new java.util.Collection that will contain the given array elements. collection.clear(); for (E e : array) { collection.add(e); return collection; |
List | arrayToCollection(Object[] objs) array To Collection return new ArrayList(Arrays.asList(objs)); |
List | arrayToCollection(String[] values) array To Collection List<String> list = new ArrayList<String>(values.length); Collections.addAll(list, values); return list; |