Software Development, Programming, Self Improvement, Java, Spring Boot.
RoleRepository roleRepository; public Role getInstance(String role) throws RoleNotFoundException { switch (role) { case "admin" -> { return roleRepository.findByName(ERole.ROLE_ADMIN); } case "user" -> { return roleRepository.findByName(ERole.ROLE_USER); } case "super_admin" -> { return