Here you can find the source of createList(T... _entries)
Parameter | Description |
---|---|
_entries | list entries |
T | list type |
@SafeVarargs public static <T> List<T> createList(T... _entries)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { /**// w ww.j av a 2 s .c om * Creates a list from a varargs parameter array. * The generic list is created with the same type as the parameters. * @param _entries list entries * @param <T> list type * @return list */ @SafeVarargs public static <T> List<T> createList(T... _entries) { List<T> l = new ArrayList<>(); if (_entries != null) { l.addAll(Arrays.asList(_entries)); } return l; } }