Here you can find the source of listOf(A... values)
Parameter | Description |
---|---|
A | Value type |
values | Comma-separated input values |
public static <A> List<A> listOf(A... values)
//package com.java2s; /******************************************************************************* * Copyright (c) 2016 Pablo Pavon-Marino. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html * * Contributors:/* w w w. j ava 2s.co m*/ * Pablo Pavon-Marino - Jose-Luis Izquierdo-Zaragoza, up to version 0.3.1 * Pablo Pavon-Marino - from version 0.4.0 onwards ******************************************************************************/ import java.util.*; public class Main { /** * Returns a list of the comma-separated input values. * * @param <A> Value type * @param values Comma-separated input values * @return List of values (iteration order equal to insertion order) */ public static <A> List<A> listOf(A... values) { return new LinkedList<A>(Arrays.asList(values)); } }