org.bdware.doip.audit.config.TempConfigStorage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doip-audit-tool Show documentation
Show all versions of doip-audit-tool Show documentation
doip audit tool developed by bdware
package org.bdware.doip.audit.config;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bdware.doip.audit.EndpointConfig;
public class TempConfigStorage implements ConfigStorage {
JsonObject content;
public TempConfigStorage(String json) {
content = JsonParser.parseString(json).getAsJsonObject();
}
@Override
public JsonObject load() {
return content;
}
@Override
public EndpointConfig loadAsEndpointConfig() {
return new Gson().fromJson(content, EndpointConfig.class);
}
@Override
public void store(JsonObject jsonObject) {
content = jsonObject;
}
}