Here you can find the source of toList(Value... values)
Parameter | Description |
---|---|
Value | the type of values |
values | more of the values |
@SafeVarargs public static <Value> List<Value> toList(Value... values)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**//from w w w.j a v a2 s .c o m * Create a list * * @param <Value> the type of values * @param values more of the values * @return the list */ @SafeVarargs public static <Value> List<Value> toList(Value... values) { List<Value> list = new ArrayList<>(); if (values != null && values.length > 0) { for (Value value : values) { list.add(value); } } return list; } }