Java Utililty Methods List from Array

List of utility methods to do List from Array

Description

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

Method

intarrayMaxInt(final List array)
array Max Int
if (array == null)
    throw new IllegalArgumentException("Array cannot be null!");
if (array.size() == 0)
    throw new IllegalArgumentException("Array size cannot be 0!");
int m = array.get(0);
for (int e : array)
    m = Math.max(m, e);
return m;
...
A[]arrayOf(List objs)
array Of
return (A[]) objs.toArray();
ListarrayToFixedSizeList(final T[] array)
array To Fixed Size List
return Arrays.asList(array);
StringarrayToInSQL(String column, List list)
array To In SQL
if (list.isEmpty())
    return null;
String appendString = "";
if (list.get(0) instanceof String) {
    appendString = "'";
StringBuilder sb = new StringBuilder(column);
sb.append(" in(");
...
StringarrayToJsonStringArr(List arr)
array To Json String Arr
StringBuilder buff = new StringBuilder("[\"");
int cnt = 0;
int len = arr.size();
for (String uid : arr) {
    buff.append(uid);
    if (cnt < len - 1) {
        buff.append("\", \"");
    cnt++;
buff.append("\"]");
return buff.toString();
ListarrayToList(@SuppressWarnings("unchecked") T... a)
Create an editable List from an Array.
List<T> l = new ArrayList<T>();
l.addAll(Arrays.asList(a));
return l;
ListarrayToList(char[] charArr)
array To List
List<Character> chList = new ArrayList<>(charArr.length);
for (char ch : charArr) {
    chList.add(ch);
return chList;
ListarrayToList(Comparable[] array)
array To List
ArrayList<Comparable> ar = new ArrayList<>();
for (int i = 0; i < array.length; i++) {
    ar.add(array[i]);
return ar;
ListarrayToList(E[] array)
array To List
List<E> list = new ArrayList<E>(array.length);
for (int i = 0; i < array.length; i++) {
    list.add(array[i]);
return list;
ListarrayToList(final String... array)
Convert Array to list.
return array != null ? Arrays.asList(array) : null;