@Override public String getProviderHint() { return filterPreference.getProviderHint(); }
@Override public boolean isEnabled() { return filterPreference.isEnabled(); }
@Override public boolean isActive() { return filterPreference.isActive(); }
@Override public Set<String> getEventTypes() { return filterPreference.getEventTypes(); }
@Override public NotificationFilterType getFilterType() { return filterPreference.getFilterType(); }
@Override public String getId() { return filterPreference.getId(); }
@Override public String getPageOnly() { return filterPreference.getPageOnly(); }
@Override public String getPage() { return filterPreference.getPage(); }
@Override public String getWiki() { return filterPreference.getWiki(); }
@Override public String getFilterName() { return filterPreference.getFilterName(); }
@Override public String getUser() { return filterPreference.getUser(); }
@Override public void setEnabled(boolean enabled) { this.filterPreference.setEnabled(enabled); } }
@Override public Set<NotificationFormat> getNotificationFormats() { return filterPreference.getNotificationFormats(); }
@Override public Date getStartingDate() { return filterPreference.getStartingDate(); }
@Override default int compareTo(Object o) { if (o instanceof NotificationFilter) { NotificationFilter other = (NotificationFilter) o; return other.getPriority() - this.getPriority(); } return 0; } }
/** * Get a displayable form of the given {@link NotificationFilterPreference}. * * @param filter the filter bound to the given preference * @param preference the filter preference to display * @return a {@link Block} that can be used to display the given notification filter * @throws NotificationException if an error occurs * * @since 9.8RC1 */ public Block displayFilterPreference(NotificationFilter filter, NotificationFilterPreference preference) throws NotificationException { return notificationFilterManager.displayFilter(filter, preference); }
/** * Delete a filter preference. * @param filterPreferenceId name of the filter preference * @throws NotificationException if an error happens * * @since 9.8RC1 */ public void deleteFilterPreference(String filterPreferenceId) throws NotificationException { notificationFilterPreferenceManager.deleteFilterPreference(documentAccessBridge.getCurrentUserReference(), filterPreferenceId); }
/** * @param filterPreference a filter preference * @param eventType the event type * @return if the filter preference concerns the event of the notification preference */ private boolean matchEventType(NotificationFilterPreference filterPreference, String eventType) { return eventType == null || filterPreference.getEventTypes().contains(eventType); } }
private boolean matchFilterType(NotificationFilterPreference pref, NotificationFilterType filterType) { return pref.getFilterType() == filterType; }
/** * @param filterPreference a filter preference * @return either or not the preference concern all event types */ private boolean matchAllEvents(NotificationFilterPreference filterPreference) { // When the list of event types concerned by the filter i // s empty, we consider that the filter concerns // all events. return filterPreference.getEventTypes().isEmpty(); } }