Java Utililty Methods List from Array

List of utility methods to do List from Array

Description

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

Method

ListasList(T... array)
as List
return Arrays.asList(array);
ListasList(T... array)
as List
return new ArrayList<T>(Arrays.asList(array));
ListasList(T... array)
as List
List<T> l = new ArrayList<T>();
for (T t : array)
    l.add(t);
return l;
CollectionasList(T... data)
as List
Collection<T> result = new ArrayList<T>();
if (data != null) {
    for (T obj : data) {
        result.add(obj);
return result;
ListasList(T... elements)
as List
ArrayList<T> result = new ArrayList<>(elements.length);
Collections.addAll(result, elements);
return result;
ListasList(T... items)
Maakt een nieuwe lijst die alle items bevat.
int length = 0;
if (items != null)
    length = items.length;
ArrayList<T> list = new ArrayList<T>(length);
if (items != null) {
    for (T item : items)
        list.add(item);
return list;
ListasList(T... values)
Create a List containing all the given values.
return Arrays.asList(values);
ListasList(T... values)
Collects the passed in objects into a List.
if (values == null) {
    return new ArrayList<T>(0);
} else {
    return new ArrayList<T>(Arrays.asList(values));
ListasList(T... values)
as List
return isEmpty(values) ? Collections.emptyList() : Arrays.asList(values);
ListasList(T[] a)
Array to List.
if (a == null)
    return Collections.emptyList();
return Arrays.asList(a);