List of utility methods to do List from Array
List | asList(final E... array) Wraps the given array into a fixed-size List of the given array type. return Arrays.asList(array);
|
List | asList(final int... values) Returns a List List<Integer> representation of an primitive int array. if (values == null) throw new IllegalArgumentException("the input array cannot be null"); return new AbstractList<Integer>() { @Override public Integer get(final int index) { return values[index]; @Override ... |
List | asList(final int[] a) takes an int array and returns a List of Integer backed by the array return new AbstractList<Integer>() { public Integer get(int i) { return a[i]; public Integer set(int i, Integer val) { Integer oldVal = a[i]; a[i] = val; return oldVal; ... |
List | asList(final int[] a) A List of Integer from an array of int. return new AbstractList<Integer>() { public Integer get(int i) { return a[i]; public Integer set(int i, Integer val) { Integer oldVal = a[i]; a[i] = val; return oldVal; ... |
List | asList(final Iterable extends T> iterable) as List return (iterable instanceof Collection) ? new LinkedList<T>((Collection<? extends T>) iterable) : new LinkedList<T>() { private static final long serialVersionUID = 3109256773218160485L; if (iterable != null) { for (final T t : iterable) { add(t); }; |
List | asList(final Iterable Converts Iterable to List . final ArrayList<T> list = new ArrayList<>(); iterable.forEach(input -> list.add(input)); return list; |
List | asList(final long[] ids) as List return asList(ids, 0, ids.length);
|
List> | asList(final Object array) as List if (array instanceof Object[]) { final Object[] arrayCasted = (Object[]) array; final List<Object> result = new ArrayList<Object>(arrayCasted.length); Collections.addAll(result, arrayCasted); return result; if (array instanceof byte[]) { final byte[] arrayCasted = (byte[]) array; ... |
List | asList(final Object[] arguments) as List return arguments != null ? Arrays.asList(arguments) : Collections.emptyList();
|
List | asList(final Object[] array) Returns a fixed-size list backed by the specified array. return Arrays.asList(array);
|