private List<NamespaceAndDefinedLocalNamesForAngular> getGroupedListOfIds(SortedSet<? extends DefinitionsChildId> allDefinitionsChildIds, String full, String includeVersions) {
Map<Namespace, ? extends List<? extends DefinitionsChildId>> groupedIds = allDefinitionsChildIds.stream().collect(Collectors.groupingBy(DefinitionsChildId::getNamespace));
return groupedIds.keySet().stream()
.sorted()
.map(namespace -> {
List<LocalNameForAngular> names = groupedIds.get(namespace).stream()
.map(definition -> {
Definitions fullDefinition = null;
if (Objects.nonNull(full)) {
fullDefinition = getFullComponentData(definition);
}
String qName = definition.getQName().toString();
String id = definition.getXmlId().toString();
if ("componentVersionOnly".equals(includeVersions)) {
qName = VersionUtils.getQNameWithComponentVersionOnly(definition);
id = qName.split("}")[1];
}
return new LocalNameForAngular(qName, id, fullDefinition);
})
.distinct()
.collect(Collectors.toList());
return new NamespaceAndDefinedLocalNamesForAngular(namespace, names);
})
.collect(Collectors.toList());
}