@Override public boolean matchesPreference(NotificationPreference preference) { return preference.getCategory().equals(NotificationPreferenceCategory.DEFAULT) && preference.getProperties().containsKey(NotificationPreferenceProperty.EVENT_TYPE); }
private String getEventType(NotificationPreference preference) { return (String) preference.getProperties().get(NotificationPreferenceProperty.EVENT_TYPE); }
@Override public ExpressionNode filterExpression(DocumentReference user, Collection<NotificationFilterPreference> filterPreferences, NotificationPreference preference) { return expressionGenerator.filterExpression(filterPreferences, (String) preference.getProperties().get(NotificationPreferenceProperty.EVENT_TYPE), preference.getFormat(), user); }
private AbstractOperatorNode getEnabledEventTypes(Collection<NotificationPreference> preferences) { AbstractOperatorNode topNode = null; for (NotificationPreference preference : preferences) { Object eventType = preference.getProperties().get(NotificationPreferenceProperty.EVENT_TYPE); if (preference.isNotificationEnabled() && eventType != null && eventType instanceof String) { AbstractOperatorNode node = value(EventProperty.TYPE).eq(value((String) eventType)) .and(value(EventProperty.DATE).greaterThan(value(preference.getStartDate()))); if (topNode == null) { topNode = node; } else { topNode = topNode.or(node); } } } return topNode; }
private String getEventType(NotificationPreference preference) { return (String) preference.getProperties().get(NotificationPreferenceProperty.EVENT_TYPE); }