List of utility methods to do Array to List
List | toList(final T[] array) Creates a modifiable list with all of the items of the provided array in the same order. if (array == null) { return null; final ArrayList<T> l = new ArrayList<>(array.length); l.addAll(Arrays.asList(array)); return l; |
ArrayList | toList(final T[] array) Returns a list of objects converted from array. final ArrayList<T> list = new ArrayList<T>(array.length); Collections.addAll(list, array); return list; |
List | toList(final T[] array) to List List<T> l = list(array.length);
l.addAll(Arrays.asList(array));
return l;
|
List | toList(final T[] array) to List if (array == null) { return Collections.emptyList(); } else { return Collections.unmodifiableList(Arrays.asList(array)); |
ArrayList | toList(final T[] array) Returns a list of objects converted from array. final ArrayList<T> list = new ArrayList<T>(array.length); Collections.addAll(list, array); return list; |
List | toList(int[] a) to List if (a == null) return null; List<Integer> li = new ArrayList<Integer>(a.length); for (int i = 0; i < a.length; i++) { li.add(a[i]); return li; |
List | toList(int[] arr) convert the int array to a list. return toList(arr, null);
|
List | toList(int[] array) Converts the given array of integers to a list of instances of class Integer List<Integer> list = new ArrayList<Integer>(); for (int i : array) { list.add(i); return list; |
List | toList(int[] array) Wandelt ein int-Array in eine Integer-Liste um. List<Integer> list = new ArrayList<Integer>(); for (int value : array) list.add(value); return list; |
ArrayList | toList(int[] from) Creates a new ArrayList from the given Array (by copying). ArrayList<Integer> list = new ArrayList<>(from.length); for (int i : from) list.add(i); return list; |