String (@NotNull MavenProject mavenProject) { var nameTemplate = Registry.stringValue("maven.import.module.name.template"); var folderName = mavenProject.getDirectoryFile().getName(); var mavenId = mavenProject.getMavenId(); var nameCandidate = switch (nameTemplate) { case "folderName" -> folderName; case "groupId.artifactId" -> mavenId.getGroupId() + "." + mavenId.getArtifactId(); default -> mavenId.getArtifactId(); }; return isValidName(nameCandidate) ? nameCandidate : folderName; }