Back to project page jive-android-core-sdk-example.
The source code is released under:
Apache License
If you think the Android project jive-android-core-sdk-example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jivesoftware.example.utils; // w w w.j a va 2 s . co m import java.util.List; /** * Created by mark.schisler on 9/17/14. */ public class Joiner { public static class Builder { private String token; Builder(String token) { this.token = token; } public String join(List<String> list) { StringBuilder builder = new StringBuilder(); for ( String string : list) { builder.append(string); builder.append(token); } if ( builder.length() > 0 && token.length() > 0 ) { builder.delete(builder.length() - token.length(), builder.length()); } return builder.toString(); } public void appendTo(StringBuilder destination, List<String> list) { destination.append(join(list)); } } public static Builder on(String s) { return new Builder(s); } }