Created
November 29, 2023 09:09
-
-
Save vladdedita/962670a01f1f26f64a788a1f48b20483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class NotificationManager { | |
@Autowired | |
private List<NotificationService> notificationServices; | |
public void sendNotifications(String message, String recipient) { | |
for (NotificationService service : notificationServices) { | |
service.sendNotification(message, recipient); | |
} | |
} | |
public List<String> getAvailableNotificationServices() { | |
return notificationServices.stream() | |
.map(NotificationService::getServiceName) | |
.collect(Collectors.toList()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment