/** * Updates links that reference other components from the composition. If a link field contains * the name of a component from the composition, it is replaced with the actual component link * through a PATCH request. */ private DeferredResult<Void> updateComponentLinks( Map<String, NestedState> componentNestedStates) { Map<String, String> componentLinks = componentNestedStates.entrySet().stream().collect( Collectors.toMap(e -> e.getKey(), e -> e.getValue().object.documentSelfLink)); List<DeferredResult<Void>> updateOps = componentNestedStates.values().stream() .map(ns -> ns.updateComponentLinks(this, componentLinks)).collect(Collectors.toList()); return DeferredResult.allOf(updateOps).thenApply(ignore -> (Void) null); }
.forEach(ns -> drs.add(ns.updateComponentLinks(sender, componentLinks)));