我有这几个函数,想知道是否可以将参数deviceEvent.hasAlarm()
传递给.map(this::sendSMS)
private void processAlarm (DeviceEvent deviceEvent) {
notificationsWithGuardians.stream()
.filter (notification -> notification.getLevels().contains(deviceEvent.getDeviceMessage().getLevel()))
.map(this::sendSMS)
.map(this::sendEmail);
}
private DeviceAlarmNotification sendSMS (DeviceAlarmNotification notification, DeviceEvent deviceEvent) {
if (deviceEvent.hasAlarm()) {
}
return notification;
}