Here you can find the source of createStringFromCollection(Collection svcInterfaces)
public static String createStringFromCollection(Collection svcInterfaces)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009 EclipseSource and others. All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Contributors:/* w w w. j a v a 2 s .c o m*/ * EclipseSource - initial API and implementation ******************************************************************************/ import java.util.*; public class Main { private static final String COLLECTION_SEPARATOR = ","; public static String createStringFromCollection(Collection svcInterfaces) { if (svcInterfaces == null) { return null; } final StringBuffer result = new StringBuffer(); for (final Iterator i = svcInterfaces.iterator(); i.hasNext();) { final String item = (String) i.next(); result.append(item); if (i.hasNext()) { result.append(COLLECTION_SEPARATOR); } } return result.toString(); } }