List of utility methods to do List Create
List | createList(E initialElement) create List List<E> res = new ArrayList<>(); res.add(initialElement); return res; |
List | createList(final T object) Creates a list with one object. final List<T> result = new ArrayList<T>(1); result.add(object); return result; |
List | createList(final T... elements) Creates a list of the given type for the given elements. if (elements == null) { return new ArrayList<T>(); } else { return new ArrayList<T>(Arrays.asList(elements)); |
List | createList(List create List if (list == null) { return null; List<T> result = new ArrayList<T>(); for (int i = 0; i < list.size(); i++) { T t = list.get(i); result.add(t); return result; |
List | createList(Object... entries) create a list and fill it with this entries List list = new ArrayList(); for (Object entry : entries) list.add(entry); return list; |
List> | createList(Object... objs) create List return createList(new ArrayList(), objs); |
List | createList(Object[] values) create List List answer = new ArrayList(values.length); answer.addAll(Arrays.asList(values)); return answer; |
List | createList(String s) Creates a new List> of String and adds s to it List<String> result = new ArrayList<String>(); result.add(s); return result; |
List | createList(T value, int n) Creates a mutable list containing n copies of value .
List<T> result = new ArrayList<>(n); for (int i = 0; i < n; i++) result.add(value); return result; |
List | createList(T... _entries) Creates a list from a varargs parameter array. List<T> l = new ArrayList<>(); if (_entries != null) { l.addAll(Arrays.asList(_entries)); return l; |