Here you can find the source of arrayToList(T[] array)
Parameter | Description |
---|---|
T | [] |
public static <T> List<T> arrayToList(T[] array)
//package com.java2s; /*/* w ww . j ava 2s .c o m*/ Pulsar Copyright (C) 2013-2015 eBay Software Foundation Licensed under the GPL v2 license. See LICENSE for full terms. */ import java.util.ArrayList; import java.util.List; public class Main { /** * Array to List converter * * @param T * [] * @return List<T> */ public static <T> List<T> arrayToList(T[] array) { List<T> list = new ArrayList<T>(); // we return at least empty list for EPL if (array != null) { for (T element : array) { list.add(element); // we don't filter null out } } return list; } }