List of utility methods to do List from Array
List | asList(Collection as List if (c instanceof List) { return (List<T>) c; } else { ArrayList<T> copy = new ArrayList<T>(); copy.addAll(c); return copy; |
List | asList(Collection as List return new ArrayList<T>(coll); |
List | asList(Collection as List return new ArrayList<T>(collection); |
List | asList(double[] array) as List List<Double> list = new ArrayList<Double>(array.length); for (int i = 0; i < array.length; i++) list.add(array[i]); return list; |
List | asList(E... elements) Converts a variable argument array into a List. List<E> list = new ArrayList<E>(elements.length); for (E element : elements) { list.add(element); return list; |
List | asList(E... pEntities) as List if (pEntities != null) { List<E> entities = new ArrayList<>(); for (E entity : pEntities) { entities.add(entity); return entities; return Collections.emptyList(); ... |
List | asList(E[] array) Given an array of a particular type, it will return it as a List of the same type. List<E> list = new ArrayList<E>(array.length); for (int i = 0; i < array.length; i++) { list.add(array[i]); return list; |
List | asList(final char[] array) as List final ArrayList<Character> list = new ArrayList<Character>(array.length); for (final char c : array) { list.add(Character.valueOf(c)); return list; |
List | asList(final Collection extends T> collection) as List List<T> result; if (collection instanceof List) { result = (List<T>) collection; } else { result = newList(collection); return result; |
List | asList(final Collection as List if (c instanceof List) { return (List<T>) c; return new ArrayList<>(c); |