Java Utililty Methods Array to List

List of utility methods to do Array to List

Description

The list of methods to do Array to List are organized into topic(s).

Method

ListtoList(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;
ArrayListtoList(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;
ListtoList(final T[] array)
to List
List<T> l = list(array.length);
l.addAll(Arrays.asList(array));
return l;
ListtoList(final T[] array)
to List
if (array == null) {
    return Collections.emptyList();
} else {
    return Collections.unmodifiableList(Arrays.asList(array));
ArrayListtoList(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;
ListtoList(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;
ListtoList(int[] arr)
convert the int array to a list.
return toList(arr, null);
ListtoList(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;
ListtoList(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;
ArrayListtoList(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;