class ModelMapper {

    public DbModule getDbModule(final Module module) {
        final DbModule dbModule = new DbModule();

        dbModule.setName(module.getName());
        dbModule.setVersion(module.getVersion());
        dbModule.setPromoted(module.isPromoted());
        dbModule.setSubmodule(module.isSubmodule());
        dbModule.setCreatedDateTime(module.getCreatedDateTime());
        dbModule.setUpdatedDateTime(module.getUpdatedDateTime());

        // Artifact
        for (final Artifact artifact : module.getArtifacts()) {
            final DbArtifact dbArtifact = getDbArtifact(artifact);
            dbModule.addArtifact(dbArtifact);
        }

        // Dependencies
        for (final Dependency dependency : module.getDependencies()) {
            dbModule.addDependency(dependency.getTarget().getGavc(), dependency.getScope());
        }

        // SubModules
        final StringBuilder sb = new StringBuilder();
        for (final Module submodule : module.getSubmodules()) {
            final DbModule dbSubmodule = getDbModule(submodule);
            dbModule.addSubmodule(dbSubmodule);
            sb.setLength(0);
        }

        return dbModule;
    }

    public  ModelMapper(final RepositoryHandler repoHandler);

}