use of com.eclipsesource.json.JsonValue in project hazelcast by hazelcast.
the class JsonUtil method getFloat.
/**
* 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();
}
use of com.eclipsesource.json.JsonValue in project hazelcast by hazelcast.
the class JsonUtil method getLong.
/**
* 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();
}
use of com.eclipsesource.json.JsonValue in project hazelcast by hazelcast.
the class JsonUtil method getDouble.
/**
* 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();
}
use of com.eclipsesource.json.JsonValue in project hazelcast by hazelcast.
the class JsonUtil method getBoolean.
/**
* 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();
}
use of com.eclipsesource.json.JsonValue in project hazelcast by hazelcast.
the class JsonUtil method getInt.
/**
* 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();
}
Aggregations