List of utility methods to do List from Array
List | asList(Iterable as List if (List.class.isAssignableFrom(iterable.getClass())) { return (List<T>) iterable; } else { List<T> list = new ArrayList<T>(); for (T item : iterable) { list.add(item); return list; ... |
List | asList(Iterable Returns a {List} of the contents for the given {Iterable} List<T> list = new ArrayList<T>(); for (T item : iterable) { list.add(item); return list; |
List | asList(Iterable as List List<T> list = new ArrayList<T>(); Iterator<T> it = iterable.iterator(); while (it.hasNext()) { T element = it.next(); if (element != null) { list.add(element); return list; |
List | asList(Iterator as List List<T> list = new ArrayList<T>(); while (iterator.hasNext()) list.add(iterator.next()); return list; |
String | asList(List as List StringBuffer buffer = new StringBuffer(); if (list != null) { if (list.size() == 1) { buffer.append(list.get(0)); } else { for (String element : list) { buffer.append(element); buffer.append(", "); ... |
List | asList(long... array) as List if (array == null) return Collections.emptyList(); List<Long> ret = new ArrayList<Long>(array.length); for (long element : array) { ret.add(element); return ret; |
List | asList(Object info) as List List<Number> list = new ArrayList<Number>(); if (info instanceof int[]) { int[] array = (int[]) info; for (int i : array) { list.add(i); } else if (info instanceof long[]) { long[] array = (long[]) info; ... |
List | asList(Object o, Class as List if (o == null) return null; if (o instanceof Collection) { return asList((Collection<?>) o, cls); return asList(newList(o), cls); |
List | asList(Object theone) Return a new List that contains [theone] element. ArrayList single = new ArrayList(1); single.add(theone); return single; |
List | asList(Object value) as List return (List<Object>) value;
|