
com.megaport.api.dto.notifications.NotificationPreferencesDto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
This library is a Java wrapper for the Megaport API.
The newest version!
package com.megaport.api.dto.notifications;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonGetter;
public class NotificationPreferencesDto {
private EnumMap> destinations;
public NotificationPreferencesDto() {
destinations = new EnumMap<>(MessageDestination.class);
}
public NotificationPreferencesDto(MessageDestination messageDestination,
List preferences) {
this();
addPreferences(preferences, messageDestination);
}
public void addPreferences(List preferences, MessageDestination forDestination) {
List existing = destinations.get(forDestination);
if (existing == null) {
existing = new ArrayList<>();
}
existing.addAll(preferences);
}
public void addPreference(MessageGroupPreferencesDto preference, MessageDestination forDestination) {
addPreferences(Collections.singletonList(preference), forDestination);
}
@JsonGetter
public EnumMap> getDestinations() {
return destinations;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy