/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.juick.json; import java.util.ArrayList; import java.util.Iterator; /** * * @author ugnich */ public class Users { public static String arrayToString(ArrayList users) { String json = "["; Iterator i = users.iterator(); while (i.hasNext()) { com.juick.User u = i.next(); if (json.length() > 1) { json += ","; } json += "{\"uid\":" + u.UID + ",\"uname\":\"" + u.UName + "\"}"; } json += "]"; return json; } }