The list of methods to do Json Get are organized into topic(s).
boolean
getBoolean(JsonObject json, String name) Returns the value for the specified parameter name included in the specified json object.
return (json != null && json.containsKey(name)) && json.getBoolean(name);
Boolean
getBooleanValue(JsonValue value) Convert a JsonValue into a equivalent Java Boolean.
switch (value.getValueType()) {
case TRUE:
return true;
case FALSE:
return false;
default:
throw new ClassCastException();
JsonBuilderFactory
getBuilderFactory() get Builder Factory
Map<String, Object> config = new HashMap<String, Object>();
return Json.createBuilderFactory(config);
int
getInt(JsonObject json, String name) Returns the value for the specified parameter name included in the specified json object.
return (json != null && json.containsKey(name)) ? json.getInt(name) : -1;
ArrayList
getIntegerArrayList(JsonArray array)
get Integer Array List
ArrayList<Integer> res = new ArrayList<Integer>(array.size());
for (JsonValue v : array) {
res.add(((JsonNumber) v).intValue());
return res;
ArrayList
getIntegerArrayListSansDoublons(JsonArray array)
get Integer Array List Sans Doublons
ArrayList<Integer> resDoublons = getIntegerArrayList(array);
HashSet<Integer> set = new HashSet<Integer>(resDoublons.size());
set.addAll(resDoublons);
return new ArrayList<Integer>(set);
JsonArray
getJsonIntArray(Iterable integers) get Json Int Array
JsonArrayBuilder builder = Json.createArrayBuilder();
for (int i : integers) {
builder.add(i);
return builder.build();