Java List to String toStringList(List as)

Here you can find the source of toStringList(List as)

Description

to String List

License

Open Source License

Declaration

public static <T> List<String> toStringList(List<T> as) 

Method Source Code


//package com.java2s;
//License from project: GNU General Public License 

import java.util.ArrayList;

import java.util.Collection;

import java.util.List;

public class Main {
    public static <T> List<String> toStringList(List<T> as) {
        List<String> strings = makeList();
        for (T a : as) {
            strings.add(a.toString());// www.j  a  v a 2s. c o m
        }
        return strings;
    }

    public static <T> List<T> makeList() {
        return new ArrayList<T>();
    }

    public static <T> List<T> makeList(Collection<T> as) {
        return new ArrayList<T>(as);
    }
}

Related

  1. toStringList(List list)
  2. toStringList(List list)
  3. toStringList(List source)
  4. toStringList(List intList)
  5. toStringList(List l)
  6. toStringList(Map stringMap, String delim)
  7. toStringList(Scanner scanner, String toSplit, final char separator)
  8. toStringReplaceBrackets(List list)
  9. toStringResult(List list)

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