List of utility methods to do Json Get
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;
|
int[] | getIntArray(JsonObject object, String name) get Int Array return toIntArray(getJsonArray(object, name));
|
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 | getJsonArray(JsonObject object, String name) get Json Array if (hasKey(object, name)) { return object.getJsonArray(name); return null; |
JsonArray | getJsonIntArray(Iterable get Json Int Array JsonArrayBuilder builder = Json.createArrayBuilder(); for (int i : integers) { builder.add(i); return builder.build(); |
JsonNumber | getJsonNumberOrNull(JsonObject object, String key) get Json Number Or Null return object.containsKey(key) && !object.isNull(key) ? object.getJsonNumber(key) : null;
|