All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bdware.doip.audit.config.TempConfigStorage Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy