/** * This method convert list of dto objects to model object. * * @param notificationList the notification list * @return converted list of model objects */ public static List<MongoNotification> convertToModelList( List<NotificationDto> notificationList) { List<MongoNotification> notifications = null; if (notificationList != null && !notificationList.isEmpty()) { notifications = new ArrayList<>(); for (NotificationDto dto : notificationList) { notifications.add(new MongoNotification(dto)); } } return notifications; }
@Override public MongoNotification save(NotificationDto notification) { return save(new MongoNotification(notification)); } }
/** * Create new instance of <code>MongoEndpointNotification</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public MongoEndpointNotification(EndpointNotificationDto dto) { this.id = dto.getId(); this.endpointKeyHash = getArrayCopy(dto.getEndpointKeyHash()); this.notification = dto.getNotificationDto() != null ? new MongoNotification(dto.getNotificationDto()) : null; }