@Override public Array createArray() { return new JsonArray(); }
/** * Returns the {@link JsonArray} at the given index, or null if it does not exist or is the wrong type. */ public Json.Array getArray(int key) { return getArray(key, (Json.Array)null); }
/** * Returns the {@link Double} at the given index, or 0.0 if it does not exist or is the wrong type. */ public double getDouble(int key) { return getDouble(key, 0); }
@Override public JsonBuilder<T> value(Object o) { arr().add(o); return this; }
/** * Returns the {@link Float} at the given index, or 0.0f if it does not exist or is the wrong type. */ public float getNumber(int key) { return getNumber(key, 0); }
/** * Returns the {@link JsonObject} at the given index, or null if it does not exist or is the wrong type. */ public Json.Object getObject(int key) { return getObject(key, null); }
/** * Returns the {@link Long} at the given index, or 0 if it does not exist or is the wrong type. */ public long getLong(int key) { return getLong(key, 0); }
/** * Returns the {@link Boolean} at the given index, or false if it does not exist or is the wrong type. */ public boolean getBoolean(int key) { return getBoolean(key, false); }
/** * Returns the {@link Integer} at the given index, or 0 if it does not exist or is the wrong type. */ public int getInt(int key) { return getInt(key, 0); }
/** * Returns the {@link Double} at the given index, or 0.0 if it does not exist or is the wrong type. */ public double getDouble(int key) { return getDouble(key, 0); }
@Override public JsonBuilder<T> value(Object o) { arr().add(o); return this; }
/** * Returns the {@link Float} at the given index, or 0.0f if it does not exist or is the wrong type. */ public float getNumber(int key) { return getNumber(key, 0); }
/** * Returns the {@link JsonObject} at the given index, or null if it does not exist or is the wrong type. */ public Json.Object getObject(int key) { return getObject(key, null); }
/** * Returns the {@link Long} at the given index, or 0 if it does not exist or is the wrong type. */ public long getLong(int key) { return getLong(key, 0); }
/** * Returns the {@link Boolean} at the given index, or false if it does not exist or is the wrong type. */ public boolean getBoolean(int key) { return getBoolean(key, false); }
/** * Returns the {@link Integer} at the given index, or 0 if it does not exist or is the wrong type. */ public int getInt(int key) { return getInt(key, 0); }
/** * Returns true if the array has a string element at that index. */ public boolean isString(int key) { return get(key) instanceof String; }