aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/json/Users.java
blob: eda89ccbb1ed500d7da7832a1b52e97ea7a60dad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * 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<com.juick.User> users) {
        String json = "[";

        Iterator<com.juick.User> 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;
    }
}