Java Utililty Methods Array to ArrayList

List of utility methods to do Array to ArrayList

Description

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

Method

ArrayListarrayToArrayList(Object aobj[])
array To Array List
ArrayList<Object> arraylist = new ArrayList<Object>();
if (aobj != null && aobj.length > 0) {
    for (int i = 0; i < aobj.length; i++)
        arraylist.add(aobj[i]);
return arraylist;
ArrayListarrayToArrayList(Object[] array)
Convert array into list
ArrayList list = new ArrayList();
if (array != null)
    for (int i = 0; i < array.length; i++)
        list.add(array[i]);
return list;
ArrayListarrayToArrayList(Object[] myArray)
This method converts an array into an ArrayList.
int i = 0;
ArrayList out = new ArrayList();
for (i = 0; i < myArray.length; i++) {
    Object extract = myArray[i];
    out.add(extract);
return (out);
ArrayListarrayToArraylist(String[] array)
array To Arraylist
return new ArrayList<String>(Arrays.asList(array));
ArrayListarrayToArrayList(T[] array)
Converts a Java array to an ArrayList .
if (array == null)
    throw new IllegalArgumentException("Parameter 'array' cannot be null!");
ArrayList<T> arrayList = new ArrayList<T>();
for (T element : array)
    arrayList.add(element);
return arrayList;
ArrayListarrayToArraylist(T[] array)
array To Arraylist
ArrayList<T> ret = new ArrayList<T>();
for (T e : array) {
    ret.add(e);
return ret;
ArrayListasArrayList(Collection c)
as Array List
return (ArrayList) asTargetTypeCollection(c, ArrayList.class);
ArrayListasArrayList(T... elements)
as Array List
ArrayList<T> result = new ArrayList<T>();
for (T elem : elements) {
    result.add(elem);
return result;
ArrayListasArrayList(T[] tArray)
Converts the typed Array into a typed ArrayList
ArrayList<T> tList = new ArrayList<T>();
for (T t : tArray) {
    tList.add(t);
return tList;
ListasArrayList(T[] values)
Arrays.asList cannot be reliably used for SQL parameters on MyBatis < 3.3.0
ArrayList<T> result = new ArrayList<T>();
Collections.addAll(result, values);
return result;