/** * Copies an iterable's elements into an array. * * @param iterable the iterable to copy * @param type the type of the elements * @return a newly-allocated array into which all the elements of the iterable have been copied */ public static <T> T[] toArray(Iterable<? extends T> iterable, Class<T> type) { Collection<? extends T> collection = toCollection(iterable); T[] array = New.array(type, collection.size()); return collection.toArray(array); }
bp.setValue(bean, arr); }else{ Object[] arr = New.array(type.getComponentType(), index+1); arr[index] = Converts.convert(value, type.getComponentType()); bp.setValue(bean, arr);