List of utility methods to do Array to List
List | newList(int... sizes) new List int size = 0; for (int it : sizes) size += it; return new ArrayList<V>(size); |
List | newList(T... elements) Creates a new ArrayList from the elements. return new ArrayList<T>(Arrays.asList(elements)); |
List | newList(T... elements) Create ArrayList with some elements contained. ArrayList<T> result = new ArrayList<>(); for (T element : elements) { result.add(element); return result; |
List | newList(T... items) Convert a vararg list of items into a List. return addToList(new ArrayList<T>(items != null ? items.length : 0), items); |
ArrayList | newList(T... list) new List return new ArrayList<T>(Arrays.asList(list)); |
List | newList(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; |
List | newList(T... objs) new List List<T> result = new ArrayList<>(objs.length); Collections.addAll(result, objs); return result; |
ArrayList | newList(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; |
List | newList(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)); |
List | newList(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; |