Java List Create createList(Class itemClazz, T... items)

Here you can find the source of createList(Class itemClazz, T... items)

Description

Creates the list.

License

Open Source License

Parameter

Parameter Description
itemClazz the item clazz
items the items

Return

the list< t>

Declaration

public static <T> List<T> createList(Class<T> itemClazz, T... items) 

Method Source Code

//package com.java2s;
/*/*from  ww w  . j a va2 s  .  c om*/
 * Copyright: (c) 2004-2010 Mayo Foundation for Medical Education and 
 * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
 * triple-shield Mayo logo are trademarks and service marks of MFMER.
 *
 * Except as contained in the copyright notice above, or as used to identify 
 * MFMER as the author of this software, the trade names, trademarks, service
 * marks, or product names of the copyright holder shall not be used in
 * advertising, promotion or otherwise in connection with this software without
 * prior written authorization of the copyright holder.
 * 
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 * 
 *       http://www.eclipse.org/legal/epl-v10.html
 * 
 */

import java.util.ArrayList;

import java.util.List;

public class Main {
    /**
     * Creates the list.
     * 
     * @param itemClazz the item clazz
     * @param items the items
     * 
     * @return the list< t>
     */
    public static <T> List<T> createList(Class<T> itemClazz, T... items) {
        List<T> returnList = new ArrayList<T>();
        for (T item : items) {
            returnList.add(item);
        }
        return returnList;
    }
}

Related

  1. createKeyValPair(List lst)
  2. createLimitSql(StringBuilder sql, Integer startNum, Integer rowNum, List params)
  3. createList( Iterator iterator )
  4. createList()
  5. createList(Class elementClass)
  6. createList(Collection collection)
  7. createList(Collection collection)
  8. createList(Collection collection)
  9. createList(E initialElement)

  10. HOME | Copyright © www.java2s.com 2016