package _VisualDVM.ServerObjectsCache;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
import _VisualDVM.TestingSystem.DVM.DVMPackageConfiguration.DVMPackageConfiguration;

import java.util.Vector;
public class DVMPackageCache extends PackageCache {
    public DVMPackageCache(DVMPackage dvmPackage) {
        Vector<String> configurationsDescriptions = new Vector<>();
        Vector<DVMPackageConfiguration> package_configurations = Global.testingServer.db.getVectorByFK(dvmPackage, DVMPackageConfiguration.class);
        for (DVMPackageConfiguration packageConfiguration : package_configurations) {
            String description = packageConfiguration.description;
            if (!Global.testingServer.db.dvmConfigurations.containsKey(packageConfiguration.dvmconfiguration_id)) {
                description = Utils_.strikeThrough(description);
            }
            configurationsDescriptions.add(description);
        }
        confifurationsDescriptionsLine = String.join(";", configurationsDescriptions);
    }
}
