Code example for JsonObject

Methods: getAsJsonObject

0
 
    private JsonObject getJsonObjectOrNull(JsonObject object, String index) {
        if (object == null)
            return null; 
        else 
            return object.getAsJsonObject(index);
    } 
 
    private JsonArray getJsonArrayOrNull(JsonObject object, String index) {
        if (object == null)
            return null; 
        else 
            return object.getAsJsonArray(index);
    } 
 
    private double getJsonDoubleOrNull(JsonObject object, String index) {
        if (object == null)
            return 0; 
        else 
            return object.getAsJsonPrimitive(index).getAsDouble();
Connect your IDE to all the code out there  Get Codota for Java