summaryrefslogtreecommitdiffstats
path: root/model/policy-model/src/main/java
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2021-01-25 11:03:42 +0000
committera.sreekumar <ajith.sreekumar@bell.ca>2021-01-28 13:14:51 +0000
commit658e67bc821a3bc55f2c6d877e7e0baa21427333 (patch)
tree5ab53c6026317858aec8b61bf0aec37459247cf5 /model/policy-model/src/main/java
parent84f92b44e70ce27bb4213da677d50ac91169432c (diff)
Improve handling of multiple policy in APEX PDP
Change-Id: Ic4adf5bd8876dc31fc93993298e90389baaa2c39 Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'model/policy-model/src/main/java')
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelMerger.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelMerger.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelMerger.java
index 90d5b7fd2..ae0dda814 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelMerger.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelMerger.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -145,7 +145,16 @@ public final class PolicyModelMerger {
return mergedPolicyModel;
}
- private static <V> void checkForDuplicateItem(Map<AxArtifactKey, V> mergedItemsMap,
+ /**
+ * Method to check for duplicate items.
+ *
+ * @param <V> the concept type
+ * @param mergedItemsMap the map to which items are copied
+ * @param copyOverItemsMap the map from where items are copied
+ * @param errorMessage error message in case of any duplicate concepts
+ * @param itemType the type of concept to specify distinguished error messages
+ */
+ public static <V> void checkForDuplicateItem(Map<AxArtifactKey, V> mergedItemsMap,
Map<AxArtifactKey, V> copyOverItemsMap, StringBuilder errorMessage, String itemType) {
for (Entry<AxArtifactKey, V> entry : copyOverItemsMap.entrySet()) {
V item = mergedItemsMap.get(entry.getKey());