use of org.neo4j.causalclustering.load_balancing.Role in project neo4j by neo4j.
the class ResultFormatV1 method parse.
private static Map<Role, List<Endpoint>> parse(List<Map<String, Object>> result) {
Map<Role, List<Endpoint>> endpoints = new HashMap<>();
for (Map<String, Object> single : result) {
Role role = Role.valueOf((String) single.get("role"));
List<Endpoint> addresses = parse((Object[]) single.get("addresses"), role);
endpoints.put(role, addresses);
}
Arrays.stream(Role.values()).forEach(r -> endpoints.putIfAbsent(r, Collections.emptyList()));
return endpoints;
}