use of io.lumeer.api.model.NotificationFrequency in project engine by Lumeer.
the class NotificationSettingCodec method convertFromDocument.
public static NotificationSetting convertFromDocument(final Document bson) {
final String notificationTypeString = bson.getString(NotificationSetting.NOTIFICATION_TYPE);
final NotificationType notificationType = notificationTypeString != null ? NotificationType.valueOf(notificationTypeString) : null;
final String notificationChannelString = bson.getString(NotificationSetting.NOTIFICATION_CHANNEL);
final NotificationChannel notificationChannel = notificationChannelString != null ? NotificationChannel.valueOf(notificationChannelString) : null;
final String notificationFrequencyString = bson.getString(NotificationSetting.NOTIFICATION_FREQUENCY);
final NotificationFrequency notificationFrequency = notificationFrequencyString != null ? NotificationFrequency.valueOf(notificationFrequencyString) : null;
return new NotificationSetting(notificationType, notificationChannel, notificationFrequency);
}
Aggregations