/** * Returns true if the object has a boolean element at that key. */ public boolean isBoolean(String key) { return get(key) instanceof Boolean; }
/** * Returns true if the object has a number element at that key. */ public boolean isNumber(String key) { return get(key) instanceof Number; }
/** * Returns the {@link JsonArray} at the given key, or the default if it does not exist or is the * wrong type. */ public Json.Array getArray(String key, Json.Array default_) { Object o = get(key); return (o instanceof Json.Array) ? (Json.Array) o : default_; }
/** * Returns true if the object has a object element at that key. */ public boolean isString(String key) { return get(key) instanceof String; }
/** * Returns true if the object has a null element at that key. */ public boolean isNull(String key) { return get(key) == null; }
/** * Returns true if the object has a string element at that key. */ public boolean isObject(String key) { return get(key) instanceof Json.Object; }
/** * Returns true if the object has a number element at that key. */ public boolean isNumber(String key) { return get(key) instanceof Number; }
/** * Returns the {@link String} at the given key, or the default if it does not exist or is the * wrong type. */ public String getString(String key, String default_) { Object o = get(key); return (o instanceof String) ? (String)o : default_; }
/** * Returns true if the object has an array element at that key. */ public boolean isArray(String key) { return get(key) instanceof Json.Array; }
/** * Returns true if the object has a object element at that key. */ public boolean isString(String key) { return get(key) instanceof String; }
/** * Returns the {@link String} at the given key, or the default if it does not exist or is the * wrong type. */ public String getString(String key, String default_) { Object o = get(key); return (o instanceof String) ? (String)o : default_; }
/** * Returns true if the object has an array element at that key. */ public boolean isArray(String key) { return get(key) instanceof Json.Array; }
/** * Returns true if the object has a boolean element at that key. */ public boolean isBoolean(String key) { return get(key) instanceof Boolean; }
/** * Returns true if the object has a string element at that key. */ public boolean isObject(String key) { return get(key) instanceof Json.Object; }
/** * Returns the {@link Double} at the given key, or the default if it does not exist or is the * wrong type. */ public double getDouble(String key, double default_) { Object o = get(key); return o instanceof Number ? ((Number) o).doubleValue() : default_; }
/** * Returns the {@link Float} at the given key, or the default if it does not exist or is the wrong * type. */ public float getNumber(String key, float default_) { Object o = get(key); return o instanceof Number ? ((Number) o).floatValue() : default_; }
/** * Returns the {@link Integer} at the given key, or the default if it does not exist or is the * wrong type. */ public int getInt(String key, int default_) { Object o = get(key); return o instanceof Number ? ((Number) o).intValue() : default_; }
/** * Returns the {@link Integer} at the given key, or the default if it does not exist or is the * wrong type. */ public int getInt(String key, int default_) { Object o = get(key); return o instanceof Number ? ((Number) o).intValue() : default_; }
/** * Returns the {@link Long} at the given key, or the default if it does not exist or is the * wrong type. */ public long getLong(String key, long default_) { Object o = get(key); return o instanceof Number ? ((Number) o).longValue() : default_; }
/** * Returns the {@link Integer} at the given key, or the default if it does not exist or is the * wrong type. */ public int getInt(String key, int default_) { Object o = get(key); return o instanceof Number ? ((Number) o).intValue() : default_; }