use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AlarmType in project open-smart-grid-platform by OSGP.
the class PushNotificationsAlarmConverter method convert.
@Override
public RetrievePushNotificationAlarmResponse convert(final PushNotificationAlarm source, final Type<? extends RetrievePushNotificationAlarmResponse> destinationType, final MappingContext context) {
if (source == null) {
return null;
}
final RetrievePushNotificationAlarmResponse response = new RetrievePushNotificationAlarmResponse();
response.setDeviceIdentification(source.getDeviceIdentification());
final AlarmRegister alarmRegister = new AlarmRegister();
final List<AlarmType> alarmTypes = alarmRegister.getAlarmTypes();
final Set<org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmType> alarms = source.getAlarms();
for (final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmType alarm : alarms) {
alarmTypes.add(AlarmType.valueOf(alarm.name()));
}
response.setAlarmRegister(alarmRegister);
return response;
}
Aggregations