summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
diff options
context:
space:
mode:
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.java15
1 files changed, 14 insertions, 1 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 b23cdfc8d..6fc36ebb6 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
@@ -3,7 +3,7 @@
* Copyright (C) 2021 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2022 Nordix Foundation.
- * Modifications Copyright (C) 2022 TechMahindra Ltd.
+ * Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@ public class DataNodeBuilder {
private String parentNodeXpath = "";
private Map<String, Serializable> leaves = Collections.emptyMap();
private Collection<DataNode> childDataNodes = Collections.emptySet();
+ private String anchorName;
/**
* To use parent node xpath for creating {@link DataNode}.
@@ -89,6 +90,17 @@ public class DataNodeBuilder {
}
/**
+ * To use anchor name for creating {@link DataNode}.
+ *
+ * @param anchorName anchor name for the data node
+ * @return DataNodeBuilder
+ */
+ public DataNodeBuilder withAnchor(final String anchorName) {
+ this.anchorName = anchorName;
+ return this;
+ }
+
+ /**
* To use module name for prefix for creating {@link DataNode}.
*
* @param moduleNamePrefix module name as prefix
@@ -153,6 +165,7 @@ public class DataNodeBuilder {
dataNode.setModuleNamePrefix(moduleNamePrefix);
dataNode.setLeaves(leaves);
dataNode.setChildDataNodes(childDataNodes);
+ dataNode.setAnchorName(anchorName);
return dataNode;
}