@Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }
            RuleKey ruleKey = (RuleKey) o;
            return Objects.equals(userId, ruleKey.userId) && nType == ruleKey.nType;
        }
NotificationRulesService builds and caches {@link NotificationPreferenceEntity} simple rules on filtering notifications.

<p>This enables notification dispatchers to determine whether a given user wants to ignore a particular type or medium of notification.

<p>Rules are cached for a short period to avoid excessive database invocations and frequently rebuilding rulesets.

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/NotificationRulesService.java