From 658e67bc821a3bc55f2c6d877e7e0baa21427333 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Mon, 25 Jan 2021 11:03:42 +0000 Subject: Improve handling of multiple policy in APEX PDP Change-Id: Ic4adf5bd8876dc31fc93993298e90389baaa2c39 Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar --- .../apex/model/policymodel/handling/PolicyModelMerger.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'model/policy-model') 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 void checkForDuplicateItem(Map mergedItemsMap, + /** + * Method to check for duplicate items. + * + * @param 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 void checkForDuplicateItem(Map mergedItemsMap, Map copyOverItemsMap, StringBuilder errorMessage, String itemType) { for (Entry entry : copyOverItemsMap.entrySet()) { V item = mergedItemsMap.get(entry.getKey()); -- cgit 1.2.3-korg