use of com.liferay.apio.architect.related.RelatedCollection in project com-liferay-apio-architect by liferay.
the class RepresentableManagerImpl method _computeRepresentables.
private void _computeRepresentables() {
Map<String, List<RelatedCollection<?>>> relatedCollections = new HashMap<>();
Stream<Class<Identifier>> keyStream = getKeyStream();
keyStream.forEach(clazz -> {
Representable representable = serviceTrackerMap.getService(clazz);
String name = representable.getName();
Optional<Map<String, String>> optional = INSTANCE.getNamesOptional();
Optional<String> classNameOptional = optional.map(Map::entrySet).map(Collection::stream).orElseGet(Stream::empty).filter(entry -> Objects.equals(entry.getValue(), name)).map(Entry::getKey).findFirst();
if (classNameOptional.isPresent()) {
if (_apioLogger != null) {
_apioLogger.warning(_getDuplicateErrorMessage(clazz, name, classNameOptional.get()));
}
return;
}
INSTANCE.putName(clazz.getName(), name);
INSTANCE.putIdentifierClass(name, clazz);
INSTANCE.putRepresentor(name, _getRepresentor(unsafeCast(representable), unsafeCast(clazz), relatedCollections));
});
}
Aggregations