Here you can find the source of asStringList( Collection extends Object> objects)
Parameter | Description |
---|---|
objects | the collection of objects. |
public static List<String> asStringList( Collection<? extends Object> objects)
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { /**/* w w w . j a v a 2s. c o m*/ * Returns a list of strings, where the strings are the result of calling * String.valueOf( Object ) of each object in the given collection. * * @param objects the collection of objects. * @return a list of strings. */ public static List<String> asStringList( Collection<? extends Object> objects) { List<String> list = new ArrayList<>(); for (Object object : objects) { list.add(String.valueOf(object)); } return list; } }