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

ListnewList(int... sizes)
new List
int size = 0;
for (int it : sizes)
    size += it;
return new ArrayList<V>(size);
ListnewList(T... elements)
Creates a new ArrayList from the elements.
return new ArrayList<T>(Arrays.asList(elements));
ListnewList(T... elements)
Create ArrayList with some elements contained.
ArrayList<T> result = new ArrayList<>();
for (T element : elements) {
    result.add(element);
return result;
ListnewList(T... items)
Convert a vararg list of items into a List.
return addToList(new ArrayList<T>(items != null ? items.length : 0), items);
ArrayListnewList(T... list)
new List
return new ArrayList<T>(Arrays.asList(list));
ListnewList(T... objects)
Creates a new list containing the objects in the object array.
List list = new ArrayList(objects.length);
for (Object object : objects)
    list.add(object);
return list;
ListnewList(T... objs)
new List
List<T> result = new ArrayList<>(objs.length);
Collections.addAll(result, objs);
return result;
ArrayListnewList(T... ts)
Creates a new ArrayList and inserts the arguments, ts .
ArrayList<T> newList = new ArrayList<T>();
if (ts != null && ts.length > 0) {
    newList.addAll(Arrays.asList(ts));
return newList;
ListnewList(T... values)
A fast and easy way to build a list.It delegates to Arrays#asList(Object) .
if (null == values) {
    return new ArrayList<T>();
} else {
    return new ArrayList<T>(Arrays.asList(values));
ListnewList(V... items)
Returns a new list containing the given items.
List<V> list = new ArrayList<V>();
for (V item : items) {
    list.add(item);
return list;