/** * Returns a field in a Json object as a long. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a long */ public static long getLong(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asLong(); }
/** * Returns a field in a Json object as a string. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a string */ public static String getString(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asString(); }
/** * Returns a field in a Json object as a long. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a long */ public static long getLong(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asLong(); }
/** * Returns a field in a Json object as a double. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a double */ public static double getDouble(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asDouble(); } /**
/** * Returns a field in a Json object as an object. * Throws IllegalArgumentException if the field value is null. * * @param object the Json object * @param field the field in the Json object to return * @return the Json field value as a Json object */ public static JsonObject getObject(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asObject(); }
/** * Returns a field in a Json object as an int. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as an int */ public static int getInt(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asInt(); }
/** * Returns a field in a Json object as a string. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a string */ public static String getString(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asString(); }
/** * Returns a field in a Json object as a boolean. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a boolean */ public static boolean getBoolean(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asBoolean(); }
/** * Returns a field in a Json object as an array. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as an array */ public static JsonArray getArray(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asArray(); }
/** * Returns a field in a Json object as a boolean. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a boolean */ public static boolean getBoolean(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asBoolean(); }
/** * Returns a field in a Json object as an object. * Throws IllegalArgumentException if the field value is null. * * @param object the Json object * @param field the field in the Json object to return * @return the Json field value as a Json object */ public static JsonObject getObject(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asObject(); }
/** * Returns a field in a Json object as a float. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a float */ public static float getFloat(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asFloat(); }
/** * Returns a field in a Json object as an int. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as an int */ public static int getInt(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asInt(); }
/** * Returns a field in a Json object as a float. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a float */ public static float getFloat(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asFloat(); }
/** * Returns a field in a Json object as an array. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as an array */ public static JsonArray getArray(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asArray(); }
/** * Returns a field in a Json object as a double. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a double */ public static double getDouble(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asDouble(); } /**