Java List from Array arrayToList(T[] array)

Here you can find the source of arrayToList(T[] array)

Description

array To List

License

Apache License

Declaration

public static <T> List<T> arrayToList(T[] array) 

Method Source Code


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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {

    public static <T> List<T> arrayToList(T[] array) {
        return isArrayEmpty(array) ? new ArrayList<T>(1) : Arrays.asList(array);
    }/*from  w  ww  .j  ava2  s.c  o m*/

    public static <T> boolean isArrayEmpty(T[] array) {
        if (null == array || array.length <= 0) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. arrayToList(String[] arrValues)
  2. ArrayToList(String[] input)
  3. arrayToList(String[] str)
  4. arrayToList(T array[])
  5. arrayToList(T[] array)
  6. arrayToList(T[] array)
  7. arrayToList(T[] array)
  8. arrayToList(T[] array)
  9. arrayToList(T[] obj, List newList)