@Override public Set<NotificationFormat> getNotificationFormats() { return filterPreference.getNotificationFormats(); }
private boolean matchFormat(NotificationFilterPreference filterPreference, NotificationFormat format) { return format == null || filterPreference.getNotificationFormats().contains(format); }
private boolean matchFormat(NotificationFilterPreference filterPreference, NotificationFormat format) { return format == null || filterPreference.getNotificationFormats().contains(format); }
@Override public Stream<NotificationFilterPreference> getFilterPreferences( Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter, NotificationFilterType filterType, NotificationFormat format) { return getFilterPreferences(filterPreferences, filter, filterType).filter( preference -> preference.getNotificationFormats().contains(format)); }
private boolean doesFilterTypeAndFormatMatch(NotificationFilterPreference nfp, NotificationFormat format, NotificationFilterType type) { return nfp.getFilterType() == type && nfp.getNotificationFormats().contains(format); } }
/** * Construct a DefaultNotificationFilterPreference which is a copy of the given notificationFilterPreference. * @param notificationFilterPreference object to copy */ public DefaultNotificationFilterPreference(NotificationFilterPreference notificationFilterPreference) { if (notificationFilterPreference instanceof DefaultNotificationFilterPreference) { this.internalId = ((DefaultNotificationFilterPreference) notificationFilterPreference).internalId; this.owner = ((DefaultNotificationFilterPreference) notificationFilterPreference).owner; } this.id = notificationFilterPreference.getId(); this.filterName = notificationFilterPreference.getFilterName(); this.providerHint = notificationFilterPreference.getProviderHint(); this.enabled = notificationFilterPreference.isEnabled(); this.active = notificationFilterPreference.isActive(); this.filterType = notificationFilterPreference.getFilterType(); this.notificationFormats = notificationFilterPreference.getNotificationFormats(); this.startingDate = notificationFilterPreference.getStartingDate(); this.eventTypes = new HashSet<>(notificationFilterPreference.getEventTypes()); this.user = notificationFilterPreference.getUser(); this.pageOnly = notificationFilterPreference.getPageOnly(); this.page = notificationFilterPreference.getPage(); this.wiki = notificationFilterPreference.getWiki(); this.setNotificationFormats(notificationFilterPreference.getNotificationFormats()); }