List of utility methods to do List from Array
int | arrayMaxInt(final List 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();
|
List | arrayToFixedSizeList(final T[] array) array To Fixed Size List return Arrays.asList(array);
|
String | arrayToInSQL(String column, 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("); ... |
String | arrayToJsonStringArr(List 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(); |
List | arrayToList(@SuppressWarnings("unchecked") T... a) Create an editable List from an Array. List<T> l = new ArrayList<T>(); l.addAll(Arrays.asList(a)); return l; |
List | arrayToList(char[] charArr) array To List List<Character> chList = new ArrayList<>(charArr.length); for (char ch : charArr) { chList.add(ch); return chList; |
List | arrayToList(Comparable[] array) array To List ArrayList<Comparable> ar = new ArrayList<>(); for (int i = 0; i < array.length; i++) { ar.add(array[i]); return ar; |
List | arrayToList(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; |
List | arrayToList(final String... array) Convert Array to list. return array != null ? Arrays.asList(array) : null;
|