diff options
Diffstat (limited to 'cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java')
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java b/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java index 4a9957deb..f2bde03a0 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java +++ b/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Bell Canada. All rights reserved. * Modifications Copyright (C) 2021 Pantheon.tech + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +46,7 @@ public class DataNodeBuilder { private NormalizedNode<?, ?> normalizedNodeTree; private String xpath; + private String moduleNamePrefix; private String parentNodeXpath = ""; private Map<String, Object> leaves = Collections.emptyMap(); private Collection<DataNode> childDataNodes = Collections.emptySet(); @@ -84,6 +86,17 @@ public class DataNodeBuilder { } /** + * To use module name for prefix for creating {@link DataNode}. + * + * @param moduleNamePrefix module name as prefix + * @return DataNodeBuilder + */ + public DataNodeBuilder withModuleNamePrefix(final String moduleNamePrefix) { + this.moduleNamePrefix = moduleNamePrefix; + return this; + } + + /** * To use attributes for creating {@link DataNode}. * * @param leaves for the data node @@ -136,6 +149,7 @@ public class DataNodeBuilder { private DataNode buildFromAttributes() { final var dataNode = new DataNode(); dataNode.setXpath(xpath); + dataNode.setModuleNamePrefix(moduleNamePrefix); dataNode.setLeaves(leaves); dataNode.setChildDataNodes(childDataNodes); return dataNode; |