Java List Transform transformCollectionTOList(Collection collection)

Here you can find the source of transformCollectionTOList(Collection collection)

Description

Transform of Collection to List

License

Open Source License

Parameter

Parameter Description
E a parameter
collection a parameter

Declaration

public static <E> List<E> transformCollectionTOList(Collection<E> collection) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Collection;

import java.util.List;

public class Main {
    /**/*  w  w w  . j av  a  2  s . co m*/
     * Transform of Collection to List
     * 
     * @param <E>
     * 
     * @param collection
     * @return
     */
    public static <E> List<E> transformCollectionTOList(Collection<E> collection) {

        List<E> collectionList = new ArrayList<E>();
        for (E obj : collection) {
            collectionList.add(obj);
        }

        return collectionList;
    }
}

Related

  1. stringToList(final String stringToTransform)
  2. transform(final List l)
  3. transform(List> values)
  4. transformContinuouslyVariablesByThreshold(List> data, int index, int threshold)
  5. transformIntoAList(String... elements)
  6. transformNumberedPropertiesToList(Properties props)
  7. transformStringListToString(List fileContentAsList)