prop2prefs

Unnamed repository; edit this file 'description' to name the repository.
git clone http://git.code.weiherhei.de/prop2prefs.git
Log | Files | Refs

Utils.java (551B)


      1 package de.jandankert.prefs;
      2 
      3 import java.util.Collection;
      4 import java.util.Iterator;
      5 
      6 public final class Utils
      7 {
      8 
      9     public static <T> String join(final Collection<T> objs, final String delimiter)
     10     {
     11         if (objs == null || objs.isEmpty())
     12             return "";
     13         Iterator<T> iter = objs.iterator();
     14         StringBuffer buffer = new StringBuffer(iter.next().toString());
     15         while (iter.hasNext())
     16             buffer.append(delimiter).append(iter.next().toString());
     17         return buffer.toString();
     18     }
     19 
     20 }