List of utility methods to do List from Array
List | asList(final Object[] objectArray) as List final List<Object> list = new ArrayList<Object>(); for (final Object element : objectArray) { if (Collection.class.isAssignableFrom(element.getClass())) { @SuppressWarnings("rawtypes") final Collection collection = (Collection) element; list.addAll(asList(collection.toArray())); } else { list.add(element); ... |
List | asList(final Set Returns the elements of the given set as list. final List<T> elementList = new ArrayList<T>(); elementList.addAll(elements); return elementList; |
List | asList(final T node) as List if (node == null) { return Collections.emptyList(); return Collections.singletonList(node); |
List | asList(final T... array) Returns the specified array as a List of elements. List<T> arrayList = new ArrayList<T>(array.length); Collections.addAll(arrayList, array); return arrayList; |
ArrayList | asList(final T... data) Returns data converted into list. final ArrayList<T> list = new ArrayList<T>(data.length); Collections.addAll(list, data); return list; |
List | asList(final T... data) Returns data converted into list. final List<T> list = new ArrayList<T>(data.length); Collections.addAll(list, data); return list; |
List | asList(final T[] array) Converts the given array to a List. List<T> res; if (isEmpty(array)) { res = Collections.emptyList(); } else { res = Arrays.asList(array); return res; |
List | asList(final T[] input) Return an ArrayList. final List<T> out = new ArrayList<T>(input.length); for (int i = 0; i < input.length; i++) { out.add(input[i]); return out; |
List | asList(float[] elements) Converts an array of float numbers to a list of Float s. int size = (elements != null) ? elements.length : 0; List<Float> list = new ArrayList<Float>(size); if (elements != null) { for (Float elem : elements) { list.add(elem); return list; ... |
List | asList(int... array) Returns a list given the argument array. List<Integer> list = new ArrayList<>(); for (int element : array) { list.add(element); return list; |