Project

General

Profile

« Previous | Next » 

Revision 41788

Added some utility method for ResultSetClient

View differences:

ResultSet.java
2 2

  
3 3
import javax.xml.bind.annotation.XmlRootElement;
4 4

  
5
import com.google.gson.Gson;
6

  
5 7
@XmlRootElement
6 8
public class ResultSet<T> {
7 9

  
......
16 18
		this.baseUrl = baseUrl;
17 19
	}
18 20

  
21
	public static ResultSet<?> fromJson(final String json) {
22
		Gson g = new Gson();
23
		return g.fromJson(json, ResultSet.class);
24
	}
25

  
19 26
	public String getId() {
20 27
		return this.id;
21 28
	}
......
32 39
		this.baseUrl = baseUrl;
33 40
	}
34 41

  
42
	public String toJson() {
43
		Gson g = new Gson();
44
		return g.toJson(this);
45
	}
46

  
35 47
}

Also available in: Unified diff