List of utility methods to do List from Array
List> | convertArrayToList(Object[] source) convert Array To List List<Object> list = new ArrayList<Object>(source.length); for (Object element : source) { list.add(element); return list; |
List | convertArrayToList(String[] array) convert Array To List List<String> list = new ArrayList<>(Arrays.asList(array)); return list; |
ArrayList | convertArrayToList(String[] array) Convert array to list of objects. ArrayList<String> elemList = new ArrayList<String>(); for (String element : array) { elemList.add(element); return elemList; |
void | convertArrayToList(String[] arrayStr) convert Array To List List<String> strL = Arrays.asList(arrayStr);
System.out.println("------" + strL.size());
|
List | convertArrayToList(T... objects) convert Array To List if (objects == null) return null; List<T> list = new ArrayList<T>(); for (T object : objects) list.add(object); return list; |
List | convertArrayToList(T[] array) convert Array To List return Arrays.asList(array);
|
List | convertArrayToList(T[] arrayOfObjects) convert Array To List final ArrayList<T> list = new ArrayList<T>(); Collections.addAll(list, arrayOfObjects); return list; |
List | copyToList(T... items) copy To List return new ArrayList<T>(Arrays.asList(items)); |
List | copyToList(T[] array) Copy the given array to a dynamic List . List<T> list = new ArrayList<T>(array.length); for (T elem : array) { list.add(elem); return list; |