summaryrefslogtreecommitdiff
path: root/src/io/Response.java
diff options
context:
space:
mode:
authorMaurice Laveaux <m.laveaux@student.tue.nl>2014-05-22 09:02:50 +0200
committerMaurice Laveaux <m.laveaux@student.tue.nl>2014-05-22 09:02:50 +0200
commit0c07b1d1a83ab20b4c753c40ea8048f73b3e5745 (patch)
tree47db3723c190bdb264a144b500fb6f41b2f1559f /src/io/Response.java
parent4e0fcd499a14cfc621b256f4a28f0cafe22bfc8c (diff)
downloadTwitterDataAnalytics-0c07b1d1a83ab20b4c753c40ea8048f73b3e5745.tar.gz
Changed Request response to a new Response class.
* Response contains the JsonElement, tickrate, reset and leftover data. * Removed getJsonRelaxed, because it was not used elsewhere.
Diffstat (limited to 'src/io/Response.java')
-rw-r--r--src/io/Response.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/io/Response.java b/src/io/Response.java
new file mode 100644
index 0000000..5cc36e1
--- /dev/null
+++ b/src/io/Response.java
@@ -0,0 +1,42 @@
+package io;
+
+import com.google.gson.JsonElement;
+
+/**
+ * A response object with the Jsonelement and rate limit values.
+ *
+ * @author Maurice Laveaux
+ */
+public class Response {
+
+ private final JsonElement element;
+
+ private final int rateLimitReset;
+
+ private final int rateLimitRemaining;
+
+ private final int rateLimit;
+
+ public Response(JsonElement resp, int rateLimit, int rateLimitRemaining, int rateLimitReset) {
+ this.element = resp;
+ this.rateLimit = rateLimit;
+ this.rateLimitRemaining = rateLimitRemaining;
+ this.rateLimitReset = rateLimitReset;
+ }
+
+ public JsonElement getResp() {
+ return element;
+ }
+
+ public int getRateLimit() {
+ return this.rateLimit;
+ }
+
+ public int getRateLimitRemaining() {
+ return this.rateLimitRemaining;
+ }
+
+ public int getRateLimitReset() {
+ return this.rateLimitReset;
+ }
+}