public MapConfigAdapter(MapConfig mapConfig) {
this.config = mapConfig;
}
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("name", config.getName());
root.add("memoryFormat", config.getInMemoryFormat().toString());
root.add("backupCount", config.getBackupCount());
root.add("asyncBackupCount", config.getAsyncBackupCount());
root.add("evictionPercentage", config.getEvictionPercentage());
root.add("minEvictionCheckMillis", config.getMinEvictionCheckMillis());
root.add("ttl", config.getTimeToLiveSeconds());
root.add("maxIdle", config.getMaxIdleSeconds());
root.add("maxSize", config.getMaxSizeConfig().getSize());
root.add("maxSizePolicy", config.getMaxSizeConfig().getMaxSizePolicy().toString());
root.add("readBackupData", config.isReadBackupData());
root.add("evictionPolicy", config.getEvictionPolicy().name());
root.add("mergePolicy", config.getMergePolicy());
return root;
}