use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class WanSyncConfigDTO method fromJson.
@Override
public void fromJson(JsonObject json) {
config = new WanSyncConfig();
JsonValue consistencyCheckStrategy = json.get("consistencyCheckStrategy");
if (consistencyCheckStrategy != null && !consistencyCheckStrategy.isNull()) {
config.setConsistencyCheckStrategy(ConsistencyCheckStrategy.getById((byte) consistencyCheckStrategy.asInt()));
}
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class LocalOperationStatsImpl method fromJson.
@Override
public void fromJson(JsonObject json) {
maxVisibleSlowOperationCount = getLong(json, "maxVisibleSlowOperationCount", Long.MAX_VALUE);
for (JsonValue jsonValue : getArray(json, "slowOperations")) {
SlowOperationDTO slowOperationDTO = new SlowOperationDTO();
slowOperationDTO.fromJson(jsonValue.asObject());
slowOperations.add(slowOperationDTO);
}
creationTime = getLong(json, "creationTime", -1L);
}
use of com.hazelcast.internal.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.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class JsonUtil method getObject.
/**
* 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();
}
use of com.hazelcast.internal.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();
}
Aggregations