aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/json/Messages.java
blob: a1879b0923d958e11a1c9c2496f2e60f79ceb1cd (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
package com.juick.json;

import java.util.ArrayList;
import java.util.Iterator;

/**
 *
 * @author ugnich
 */
public class Messages {

    public static String arrayToString(ArrayList<com.juick.Message> messages) {
        String json = "[";

        Iterator<com.juick.Message> i = messages.iterator();
        while (i.hasNext()) {
            com.juick.Message m = i.next();
            if (json.length() > 1) {
                json += ",";
            }
            json += Message.toJSON(m).toString();
        }

        json += "]";
        return json;
    }
}