use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EventType in project open-smart-grid-platform by OSGP.
the class EventsConverter method convertTo.
@Override
public Event convertTo(final EventDto source, final Type<Event> destinationType, final MappingContext context) {
if (source == null) {
return null;
}
final EventType eventType = EventType.valueOf(source.getEventTypeDto().name());
final List<EventDetail> eventDetails = source.getEventDetails().stream().map(sourceDetail -> new EventDetail(sourceDetail.getName(), sourceDetail.getValue())).collect(Collectors.toList());
return new Event(source.getTimestamp(), eventType, source.getEventCounter(), EventLogCategory.fromValue(source.getEventLogCategoryName()), eventDetails);
}
Aggregations