@Override public int compareTo(NamedStructureEquivalenceSet<T> rhs) { return getRepresentativeElement().compareTo(rhs.getRepresentativeElement()); }
/** * Mapping: hostname -> names of structures of this type for which named host is the * representative */ @JsonIgnore public Map<String, Set<String>> getRepresentatives() { Map<String, Set<String>> representativesByHostname = new LinkedHashMap<>(); _sameNamedStructures.forEach( (aclName, equivalenceSets) -> equivalenceSets.forEach( equivalenceSet -> representativesByHostname .computeIfAbsent( equivalenceSet.getRepresentativeElement(), n -> new LinkedHashSet<>()) .add(aclName))); return CommonUtil.toImmutableMap( representativesByHostname, Entry::getKey, e -> ImmutableSet.copyOf(e.getValue())); } }