diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2024-11-13 14:48:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-11-13 14:48:49 +0000 |
commit | efca6856f4f9654169e4c077c4da1f674b7b7099 (patch) | |
tree | f8236ee1b070d48cdabe47d749882f8814593500 /cps-ncmp-service/src/main/java | |
parent | 00da0afbadf37d80b8e17a60880ec5f8d1756b74 (diff) | |
parent | af283af05c69a93304935e152d7c83a23ac82b1e (diff) |
Merge "Hashmark support in 3gpp objects"
Diffstat (limited to 'cps-ncmp-service/src/main/java')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java index c526dfb297..9facd630a2 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java @@ -38,14 +38,15 @@ public class AlternateIdMatcher { /** * Get data node that matches longest alternate id by removing elements (as defined by the separator string) - * from right to left. + * from right to left. If alternate id contains a hash then all elements after that hash are ignored. * * @param alternateId alternate ID * @param separator a string that separates each element from the next. * @return data node */ public DataNode getCmHandleDataNodeByLongestMatchingAlternateId(final String alternateId, final String separator) { - String bestMatch = alternateId; + final String[] splitPath = alternateId.split("#", 2); + String bestMatch = splitPath[0]; while (StringUtils.isNotEmpty(bestMatch)) { try { return inventoryPersistence.getCmHandleDataNodeByAlternateId(bestMatch); |