List of usage examples for java.util List toArray
<T> T[] toArray(T[] a);
From source file:Main.java
public static String[] toArray(List<String> list) { return list.toArray(new String[list.size()]); }
From source file:Main.java
public static <T> T[] list2Array(List<T> oList) { Object[] oArray = oList.toArray(new Object[] {}); T[] ts = (T[]) oArray;//w w w. j av a2s . c om return ts; }
From source file:Main.java
@SuppressWarnings("unchecked") public static <T> T[] toArray(List<T> list, Class<T> clazz) { return list.toArray((T[]) Array.newInstance(clazz, list.size())); }
From source file:Main.java
public static String[] toArray(final List<String> values) { return values.toArray(new String[values.size()]); }
From source file:Main.java
public static String[] fromList(List<String> list) { return list == null ? null : list.toArray(new String[list.size()]); }
From source file:com.naver.template.common.ChunkUtils.java
public static long[] toPrimitiveArray(List<Long> list) { Long[] array = list.toArray(new Long[0]); return ArrayUtils.toPrimitive(array); }
From source file:Main.java
@SuppressWarnings("unchecked") public static <E extends Object> E[] toArray(List<E> list, Class<E> clazz) { return list.toArray((E[]) Array.newInstance(clazz, list.size())); }
From source file:Main.java
public static long[] toPrimitives(List<Long> objects) { return toPrimitives(objects.toArray(new Long[objects.size()])); }
From source file:Main.java
public static <T> T[] toArray(List<T> list, Class<T> cls) { return (T[]) list.toArray(createArray(cls, list.size())); }
From source file:Main.java
public static String[] toStrArray(List<String> arrList) { String[] r = new String[arrList.size()]; arrList.toArray(r); return r;//from ww w.ja va 2 s. c o m }