class RoleDimensionMapping implements Comparable<RoleDimensionMapping> {

  public SortedMap<String, String> createNodeRolesMap(Set<String> nodeNames) {
    SortedMap<String, String> m = new TreeMap<>();
    for (String node : nodeNames) {
      Optional<String> optRoleName = roleNameForNode(node);
      optRoleName.ifPresent(roleName -> m.put(node, roleName));
    }
    return m;
  }

  @JsonCreator public  RoleDimensionMapping(
      @JsonProperty(PROP_REGEX) String regex,
      @JsonProperty(PROP_GROUPS) @Nullable List<Integer> groups,
      @JsonProperty(PROP_CANONICAL_ROLE_NAMES) @Nullable Map<String, String> canonicalRoleNames);
  public  RoleDimensionMapping(String regex);
  public  RoleDimensionMapping(NodeRole role);

}