Java Utililty Methods Array to List

List of utility methods to do Array to List

Description

The list of methods to do Array to List are organized into topic(s).

Method

ListtoList(Object[] arr)
to List
List<Object> ret = new ArrayList<Object>();
Collections.addAll(ret, arr);
return ret;
ListtoList(Object[] array)
Description of the Method
return to_list(array);
ListtoList(Object[] array)
We could have used the Arraya.asList() method but that returns an *immutable* list !!!!!
if (array == null) {
    return new ArrayList();
} else {
    ArrayList list = new ArrayList();
    for (int i = 0; i < array.length; i++) {
        list.add(array[i]);
    return list;
...
ListtoList(Object[] array)
to List
List list = Collections.EMPTY_LIST;
if (array != null) {
    list = new ArrayList(array.length);
    for (int i = 0; i < array.length; i++) {
        list.add(array[i]);
return list;
...
ListtoList(Object[] array)
to List
ArrayList list = new ArrayList();
for (int i = 0; i < array.length; i++) {
    list.add(array[i]);
return list;
ArrayListtoList(Object[] array)
Converts the supplied object list into an ArrayList
if (array == null) {
    return null;
final int len = array.length;
ArrayList rs = new ArrayList(len);
for (int i = 0; i < len; i++) {
    rs.add(array[i]);
return rs;
ArrayListtoList(Object[] data)
Converts an array to an ArrayList
ArrayList<Object> result = new ArrayList<Object>();
result.add(Arrays.asList(data));
return result;
ListtoList(Object[] input)
Converts an Object[] to a Collection.
if (input == null)
    return null;
return Arrays.asList(input);
ListtoList(String[] anArray)
to List
List<String> res = null;
res = Arrays.asList(anArray);
return res;
ListtoList(String[] arr)
array to list
if (null == arr) {
    return null;
List<String> list = new ArrayList<String>();
for (int i = 0; i < arr.length; i++) {
    list.add(arr[i]);
return list;
...