Back to project page inbox-android.
The source code is released under:
MIT License
If you think the Android project inbox-android 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.inboxapp.androidsdk.utils; /*from w w w . ja v a 2s. com*/ import com.inboxapp.androidsdk.json_objects.single_objects.File; import com.inboxapp.androidsdk.json_objects.single_objects.Participant; import com.inboxapp.androidsdk.json_objects.single_objects.Tag; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Iterator; /** * Created by sylvianguessan on 8/11/14. */ public class InboxAppStringUtils { public static class StringUtils { public static String getAllString(ArrayList<String> aList) { String output = new String(); if ((aList != null) && (aList.size() > 0)) { Iterator<String> itr= aList.iterator(); while (itr.hasNext()) { String element = (String) itr.next(); if (output.length() > 0) output = output + ", " + element; else output = element; } return output; } else return ""; } public static String getAllParticipantsString(ArrayList<Participant> aList) { String output = new String(); if ((aList != null) && (aList.size() > 0)) { Iterator<Participant> itr= aList.iterator(); while (itr.hasNext()) { Participant element = (Participant) itr.next(); String textStr = element.getName()+"("+element.getEmail()+")"; if (output.length() > 0) output = output + ", " + textStr; else output = textStr; } return output; } else return ""; } public static String getAllTagsString(ArrayList<Tag> aList) { String output = new String(); if ((aList != null) && (aList.size() > 0)) { Iterator<Tag> itr= aList.iterator(); while (itr.hasNext()) { Tag element = (Tag) itr.next(); String textStr = element.getName()+"( id="+element.getId()+"/name="+element.getName()+")"; if (output.length() > 0) output = output + ", " + textStr; else output = textStr; } return output; } else return ""; } public static String getAllFilesString(ArrayList<File> aList) { String output = new String(); if ((aList != null) && (aList.size() > 0)) { Iterator<File> itr= aList.iterator(); while (itr.hasNext()) { File element = (File) itr.next(); String textStr = element.getFileName()+"( id="+element.getId()+"/size="+element.getSize()+")"; if (output.length() > 0) output = output + ", " + textStr; else output = textStr ; } return output; } else return ""; } } }