Here you can find the source of collectionToString(@SuppressWarnings("rawtypes") Collection coll)
static public String collectionToString(@SuppressWarnings("rawtypes") Collection coll)
//package com.java2s; /*/*from w ww . jav a2s. co m*/ * The contents of this file are subject to the Automated Business Logic Public License Version 1.0 (the "License"), * which is derived from the Mozilla Public License version 1.1. You may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.automatedbusinesslogic.com/license/public-license * * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, * either express or implied. See the License for the specific language governing rights and limitations under the License. */ import java.util.Collection; public class Main { /** * Take a collection of anything and return it formatted as a string. * @param coll A collection of anything * @return [ <object toString>, ... ] */ static public String collectionToString(@SuppressWarnings("rawtypes") Collection coll) { if (coll == null) return ""; StringBuffer sb = new StringBuffer(); sb.append("["); for (Object o : coll) { sb.append(o.toString()); sb.append(","); } sb.append("]"); return sb.toString(); } }