class ModelMapper {

    public Module getModule(final DbModule dbModule) {
        final Module module = DataModelFactory.createModule(dbModule.getName(), dbModule.getVersion());
        module.setPromoted(dbModule.isPromoted());
        module.setSubmodule(dbModule.isSubmodule());
        module.setCreatedDateTime(dbModule.getCreatedDateTime());
        module.setUpdatedDateTime(dbModule.getUpdatedDateTime());

        // Artifacts
        for (final String gavc : dbModule.getArtifacts()) {
            // Artifacts
            final DbArtifact dbArtifact = repositoryHandler.getArtifact(gavc);
            if (null != dbArtifact) {
                final Artifact artifact = getArtifact(dbArtifact);
                module.addArtifact(artifact);
            }
        }

        // Dependencies
        for (final DbDependency dbDependency : dbModule.getDependencies()) {
            // Dependencies
            final Dependency dependency = getDependency(dbDependency, module.getName(), module.getVersion());
            dependency.setSourceName(module.getName());
            dependency.setSourceVersion(module.getVersion());
            module.addDependency(dependency);
        }

        // Submodules
        for (final DbModule dbSubmodule : dbModule.getSubmodules()) {
            module.addSubmodule(getModule(dbSubmodule));
        }

        return module;
    }

    public  ModelMapper(final RepositoryHandler repoHandler);

}