Example #1
0
 RuleActivatorContext setParentActiveRuleParams(@Nullable Collection<ActiveRuleParamDto> a) {
   parentActiveRuleParams.clear();
   if (a != null) {
     for (ActiveRuleParamDto ar : a) {
       this.parentActiveRuleParams.put(ar.getKey(), ar);
     }
   }
   return this;
 }
Example #2
0
 boolean isSame(ActiveRuleChange change) {
   ActiveRule.Inheritance inheritance = change.getInheritance();
   if (inheritance != null && !inheritance.name().equals(activeRule.getInheritance())) {
     return false;
   }
   String severity = change.getSeverity();
   if (severity != null && !severity.equals(activeRule.getSeverityString())) {
     return false;
   }
   for (Map.Entry<String, String> changeParam : change.getParameters().entrySet()) {
     ActiveRuleParamDto param = activeRuleParams.get(changeParam.getKey());
     if (changeParam.getValue() == null && param != null && param.getValue() != null) {
       return false;
     }
     if (changeParam.getValue() != null
         && (param == null || !StringUtils.equals(changeParam.getValue(), param.getValue()))) {
       return false;
     }
   }
   return true;
 }
Example #3
0
 @CheckForNull
 String parentParamValue(String key) {
   ActiveRuleParamDto param = parentActiveRuleParams.get(key);
   return param != null ? param.getValue() : null;
 }