package _VisualDVM.ServerObjectsCache;
import Common.Utils.Utils_;
import _VisualDVM.TestingSystem.Common.Configuration.Json.ConfigurationJson;
import _VisualDVM.TestingSystem.Common.Configuration.Json.ConfigurationsJson;
import _VisualDVM.TestingSystem.Common.TestingPackage.TestingPackage;

import java.util.Vector;
public class PackageCache extends VisualCache{
    public ConfigurationsJson configurationsJson = null;
    public Vector<String> configurationsDescriptions = null;
    public PackageCache(TestingPackage testingPackage){
        if (testingPackage.packedConfigurationsJson.isEmpty())
            configurationsJson = new ConfigurationsJson(); //просто пустой
        else
            configurationsJson = Utils_.gson.fromJson(testingPackage.packedConfigurationsJson, ConfigurationsJson.class);
        //---
        configurationsDescriptions=new Vector<>();
        for(ConfigurationJson configurationJson: configurationsJson.array)
            configurationsDescriptions.add(configurationJson.description);
    }
    public Vector<String> getConfigurationsDescriptions() {
        return configurationsDescriptions;
    }
}
