class QualifiedName {

    public static QualifiedName toQualifiedName(TDefinitions model, String qName) {
        if (qName == null || qName.isEmpty()) {
            return null;
        }
        if (qName.startsWith(DMNVersion.LATEST.getFeelPrefix() + ".")) {
            String prefix = DMNVersion.LATEST.getFeelPrefix();
            String localPart = qName.substring(qName.indexOf('.') + 1);
            return new QualifiedName(prefix, localPart);
        }
        if (model == null) {
            return new QualifiedName(null, qName);
        } else {
            for (TImport import_: model.getImport()) {
                String importName = import_.getName();
                if (qName.startsWith(importName + '.')) {
                    String localPart = qName.substring(qName.indexOf('.') + 1);
                    return new QualifiedName(importName, localPart);
                }
            }
            return new QualifiedName(null, qName);
        }
    }

    private  QualifiedName(String namespace, String localPart);

}