Java Utililty Methods Array to List

List of utility methods to do Array to List

Description

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

Method

ArrayListtoList(String[] array)
Creates a new ArrayList collection from the specified array of Strings.
if (array == null) {
    return new ArrayList<String>(0);
ArrayList<String> list = new ArrayList<String>(array.length);
for (String s : array) {
    list.add(s);
return list;
...
ListtoList(String[] array)
to List
return let(array, null);
ListtoList(T element, T... elements)
to List
List<T> allElements = new ArrayList<T>();
if (element != null) {
    allElements.add(element);
if (elements != null) {
    Collections.addAll(allElements, elements);
return allElements;
...
ListtoList(T value)
Returns a modifiable list containing just the specified element.
ArrayList<T> newList = new ArrayList<>();
newList.add(value);
return newList;
ListtoList(T... elements)
to List
List<T> list = Collections.emptyList();
if (elements != null) {
    list = new ArrayList<T>(elements.length);
    Collections.addAll(list, elements);
return list;
ListtoList(T... items)
Converts the supplied array into a List.
if (items == null)
    return null;
List<T> list = new ArrayList<T>(items.length);
for (T item : items)
    list.add(item);
return list;
ListtoList(T... objects)
return a list of objects from varargs.
if (objects == null) {
    return null;
if (objects.length == 1 && objects[0] instanceof List) {
    return (List<T>) objects[0];
List<T> result = new ArrayList<T>();
for (T object : objects) {
...
ListtoList(T... objects)
Converts the given objects into a List .
if (objects != null) {
    List<T> result = new ArrayList<T>(objects.length);
    for (T obj : objects) {
        result.add(obj);
    return result;
} else {
    return new ArrayList<T>(0);
...
ListtoList(T[] _array)
Generische Methode zum Umwandeln von Array in Listen
List<T> r = new ArrayList<T>();
for (int i = 0, m = _array.length; i < m; i++) {
    r.add(_array[i]);
return r;
ListtoList(T[] anArrayToConvert)
Returns a list equivalent to the array given as input.
ArrayList<T> aListToEnrich = new ArrayList<T>();
enrichList(aListToEnrich, anArrayToConvert);
return aListToEnrich;