Java Utililty Methods List Value Add All

List of utility methods to do List Value Add All

Description

The list of methods to do List Value Add All are organized into topic(s).

Method

ListaddAll(List src, T... args)
add All
if (src == null) {
    return null;
for (T t : args) {
    src.add(t);
return src;
ListaddAll(List xs, Collection adds)
add All
xs.addAll(adds);
return xs;
voidaddAll(Object[] array, List list)
add All
for (int i = 0; i < array.length; i++) {
    if (!list.contains(array[i]))
        list.add(array[i]);
voidaddAll(T[] array, List list)
add All
for (T t : array) {
    list.add(t);
voidaddAllTo(List procArgs, String[] args)
add All To
for (String arg : args) {
    procArgs.add(arg);
booleanaddAllTo(List list, T... args)
add All To
return list.addAll(asList(args));
ListaddAllToANewList(Collection... collections)
Adds all elements of given collections to a new LinkedList.
LinkedList<E> result = new LinkedList<E>();
for (Collection<E> c : collections) {
    result.addAll(c);
return result;
ListaddAllToList(List dest, Collection src)
add All To List
if (isEmpty(src)) {
    return dest;
for (T item : src) {
    if (!dest.contains(item)) {
        dest.add(item);
return dest;
ListaddAllUnique(List aList, List theObjects)
Adds all object from second list to first list (creates first list if missing).
if (aList == null)
    aList = new ArrayList();
for (T object : theObjects)
    if (!aList.contains(object))
        aList.add(object);
return aList;
ListaddAllUnique(List l1, T element)
Add the element to the list, if it is not already there.
if (!l1.contains(element)) {
    l1.add(element);
return l1;