private static Set<String> writeActiveRules(RuleKey ruleKey, Collection<OrgActiveRuleDto> activeRules, ListMultimap<ActiveRuleKey, ActiveRuleParamDto> activeRuleParamsByActiveRuleKey, Rules.Actives.Builder activesBuilder) { final Set<String> profileUuids = new HashSet<>(); Rules.ActiveList.Builder activeRulesListResponse = Rules.ActiveList.newBuilder(); for (OrgActiveRuleDto activeRule : activeRules) { activeRulesListResponse.addActiveList(buildActiveRuleResponse(activeRule, activeRuleParamsByActiveRuleKey.get(activeRule.getKey()))); profileUuids.add(activeRule.getProfileUuid()); } activesBuilder .getMutableActives() .put(ruleKey.toString(), activeRulesListResponse.build()); return profileUuids; }
activeBuilder.setSeverity(SEVERITY_VALUE); ActiveList activeList = Rules.ActiveList.newBuilder().addActiveList(activeBuilder).build(); actives.putAllActives(ImmutableSortedMap.of(key.toString(), activeList)); });
private static Set<String> writeActiveRules(RuleKey ruleKey, Collection<OrgActiveRuleDto> activeRules, ListMultimap<ActiveRuleKey, ActiveRuleParamDto> activeRuleParamsByActiveRuleKey, Rules.Actives.Builder activesBuilder) { final Set<String> profileUuids = new HashSet<>(); Rules.ActiveList.Builder activeRulesListResponse = Rules.ActiveList.newBuilder(); for (OrgActiveRuleDto activeRule : activeRules) { activeRulesListResponse.addActiveList(buildActiveRuleResponse(activeRule, activeRuleParamsByActiveRuleKey.get(activeRule.getKey()))); profileUuids.add(activeRule.getProfileUuid()); } activesBuilder .getMutableActives() .put(ruleKey.toString(), activeRulesListResponse.build()); return profileUuids; }