package _VisualDVM.ServerObjectsCache;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackageConfiguration.SapforPackageConfiguration;

import java.util.Vector;
public class SapforPackageCache extends PackageCache {
    public SapforPackageCache(SapforPackage sapforPackage) {
        Vector<String> configurationsDescriptions = new Vector<>();
        Vector<SapforPackageConfiguration> package_configurations = Global.testingServer.db.getVectorByFK(sapforPackage, SapforPackageConfiguration.class);
        for (SapforPackageConfiguration packageConfiguration : package_configurations) {
            String description = packageConfiguration.description;
            if (!Global.testingServer.db.sapforConfigurations.containsKey(packageConfiguration.sapforconfiguration_id)) {
                description = Utils_.strikeThrough(description);
            }
            configurationsDescriptions.add(description);
        }
        confifurationsDescriptionsLine = String.join(";", configurationsDescriptions);
    }
}