class Imports {

    @JsOverlay
    public static final Imports create(List<DefaultImport> defaultImports,
                                       List<WSDLImport> wsdlImports) {
        final String hidden = "hidden";
        final String visible = "";
        final Imports instance = new Imports();

        instance.totalDefaultImports = defaultImports.size();
        instance.totalWSDLImports = wsdlImports.size();
        instance.defaultImports = defaultImports.toArray(new DefaultImport[defaultImports.size()]);
        instance.wsdlImports = wsdlImports.toArray(new WSDLImport[wsdlImports.size()]);

        instance.defaultImportsHidden = hidden;
        instance.wsdlImportsHidden = hidden;
        instance.noImportsHidden = visible;
        instance.importsTableHidden = hidden;

        if (!defaultImports.isEmpty()) {
            instance.defaultImportsHidden = visible;
            instance.importsTableHidden = visible;
            instance.noImportsHidden = hidden;
        }

        if (!wsdlImports.isEmpty()) {
            instance.wsdlImportsHidden = visible;
            instance.importsTableHidden = visible;
            instance.noImportsHidden = hidden;
        }

        return instance;
    }

    private  Imports();

}