Code: Select all
Map matchesByCom = intermediateObject.getMatchDetails();
Set resultKeys = new HashSet();
intermediateObject.getNames().forEach(name -> {
final Set distinctIdsFinal = intermediateObject.getNameToIdMapping().get(name);
matchesByCom.keySet().parallelStream().filter(mKey -> mKey.getName().equals(name))
.forEach(mKey -> {
if (CollectionUtils.isEmpty(distinctIdsFinal)
|| (CollectionUtils.isEmpty(requestDTO.getLIds()))) {
resultKeys.add(name + mKey.getCom());
}
if (CollectionUtils.isNotEmpty(distinctIdsFinal)) {
distinctIdsFinal.forEach(Id -> {
resultKeys.add(name + mKey.getCom() + "_" +Id);
});
}
});
});
resultIdSetMono = fetchResult(resultKeys)