Java List Value Add All addArrayToList(List list, T[] array)

Here you can find the source of addArrayToList(List list, T[] array)

Description

add Array To List

License

Apache License

Declaration

public static <T> void addArrayToList(List<T> list, T[] array) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

import java.util.List;
import java.util.Map;

public class Main {

    public static <T> void addArrayToList(List<T> list, T[] array) {
        if (isEmpty(list)) {
            return;
        }/*from   ww w .j a va2 s  .  c o  m*/
        for (T t : array) {
            list.add(t);
        }
    }

    public static <T> boolean isEmpty(T[] array) {
        return (array == null || array.length == 0);
    }

    public static boolean isEmpty(Collection collection) {
        return (collection == null || collection.isEmpty());
    }

    public static boolean isEmpty(Map map) {
        return (map == null || map.isEmpty());
    }
}

Related

  1. addAllUniqueId(List aList, List theObjects)
  2. addAllUniqueToList(List objects, List objectsToAdd)
  3. addAllWords(String text, List result)
  4. addArrayToList(List list, String as[])
  5. addArrayToList(List list, double[] array)
  6. addArrayToList(String[] array, List list)
  7. addArrayToList(T[] array, List list)
  8. addToList(List list, Object obj)
  9. addToList(List list, I item)