Search in sources :

Example 1 with NotificationFrequency

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);
}
Also used : NotificationChannel(io.lumeer.api.model.NotificationChannel) NotificationFrequency(io.lumeer.api.model.NotificationFrequency) NotificationType(io.lumeer.api.model.NotificationType) NotificationSetting(io.lumeer.api.model.NotificationSetting)

Aggregations

NotificationChannel (io.lumeer.api.model.NotificationChannel)1 NotificationFrequency (io.lumeer.api.model.NotificationFrequency)1 NotificationSetting (io.lumeer.api.model.NotificationSetting)1 NotificationType (io.lumeer.api.model.NotificationType)1