APIClient: add the getLongArrValue implementation

This adds the implementation for getLongArrValue with and without query
parameters support.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman 2015-06-18 11:52:17 +03:00
parent 331c6c13b3
commit 37c09679ff
1 changed files with 15 additions and 4 deletions

View File

@ -352,9 +352,20 @@ public class APIClient {
return null;
}
public long[] getLongArrValue(String string,
MultivaluedMap<String, String> queryParams) {
JsonReader reader = getReader(string, queryParams);
JsonArray arr = reader.readArray();
long[] res = new long[arr.size()];
for (int i = 0; i < arr.size(); i++) {
res[i] = arr.getJsonNumber(i).longValue();
}
reader.close();
return res;
}
public long[] getLongArrValue(String string) {
// TODO Auto-generated method stub
return null;
return getLongArrValue(string, null);
}
public Map<String, Integer> getMapStringIntegerValue(String string) {
@ -396,7 +407,7 @@ public class APIClient {
reader.close();
return map;
}
public Map<String, Long> getListMapStringLongValue(String string) {
return getListMapStringLongValue(string, null);
}
@ -411,7 +422,7 @@ public class APIClient {
reader.close();
return res;
}
public JsonArray getJsonArray(String string) {
return getJsonArray(string, null);
}