Here you can find the source of toStringList(List> source)
Parameter | Description |
---|---|
source | The source list. |
public static List<String> toStringList(List<?> source)
//package com.java2s; /**//from w ww .j a v a 2 s. com * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at * http://mozilla.org/MPL/2.0/. * * This Source Code Form is also subject to the terms of the Health-Related Additional * Disclaimer of Warranty and Limitation of Liability available at * http://www.carewebframework.org/licensing/disclaimer. */ import java.util.ArrayList; import java.util.List; public class Main { /** * Converts a list of objects to a list of their string equivalents. * * @param source The source list. * @return A list of string equivalents. */ public static List<String> toStringList(List<?> source) { List<String> dest = new ArrayList<String>(source.size()); for (Object value : source) { dest.add(value.toString()); } return dest; } }