List of utility methods to do List from
String | listOf(String type) list Of return "java.util.List<" + type + ">"; |
List | listOf(T value, int size) list Of List<T> list = new ArrayList<T>(size); list.add(value); return list; |
ArrayList | listOf(T... args) list Of ArrayList<T> result = new ArrayList<T>(); for (T t : args) result.add(t); return result; |
List | listOf(T... elements) list Of List<T> list = new ArrayList<>(); for (T element : elements) { list.add(element); return list; |
List | listOf(T... elems) Returns the list of elements given as parameters. return java.util.Arrays.asList(elems);
|
List | listOf(T... values) list Of return unmodifiableList(Arrays.asList(values));
|
List | listOfArrays(T[]... values) Simple wrapper for Arrays.asList() return new ArrayList<T[]>(Arrays.asList(values)); |
String | listOfExceptionsAsString(List Lists exceptions using their toString(), one per line. StringBuilder sb = new StringBuilder(); for (Exception ex : exs) { sb.append(ex.toString()).append("\n"); return sb.toString(); |
int[] | listOfIntegers2ArrayOfInts(List list Of Integers Array Of Ints int[] xa = new int[xs.size()]; for (int i = 0; i < xa.length; ++i) { xa[i] = xs.get(i); return xa; |
String | listOfItems(List Return a string that is a list of items separated by separator and using the final conjunction. final int size = items.size(); if (size < 1) return ""; switch (size) { case 1: return items.iterator().next(); case 2: return items.get(0) + " " + finalConjunction + " " + items.get(1); ... |