summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-rest/src/main')
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
index 3e2bdd928b..449a4344dd 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
@@ -219,8 +219,7 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
final List<ConditionProperties> conditionProperties =
conditions.getConditions().stream().collect(Collectors.toList());
final CmHandles cmHandles = new CmHandles();
- final Collection<String> cmHandleIdentifiers = processConditions(conditionProperties);
- cmHandleIdentifiers.forEach(cmHandle -> cmHandles.setCmHandles(toCmHandleProperties(cmHandle)));
+ cmHandles.setCmHandles(toCmHandleProperties(processConditions(conditionProperties)));
return ResponseEntity.ok(cmHandles);
}
@@ -256,11 +255,13 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
return moduleNames;
}
- private CmHandleProperties toCmHandleProperties(final String cmHandleId) {
+ private CmHandleProperties toCmHandleProperties(final Collection<String> cmHandleIdentifiers) {
final CmHandleProperties cmHandleProperties = new CmHandleProperties();
- final CmHandleProperty cmHandleProperty = new CmHandleProperty();
- cmHandleProperty.setCmHandleId(cmHandleId);
- cmHandleProperties.add(cmHandleProperty);
+ for (final String cmHandleIdentifier : cmHandleIdentifiers) {
+ final CmHandleProperty cmHandleProperty = new CmHandleProperty();
+ cmHandleProperty.setCmHandleId(cmHandleIdentifier);
+ cmHandleProperties.add(cmHandleProperty);
+ }
return cmHandleProperties;
}