summaryrefslogtreecommitdiffstats
path: root/cps-service/src
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2023-04-05 16:16:56 +0100
committerdanielhanrahan <daniel.hanrahan@est.tech>2023-04-11 13:20:45 +0100
commitfe25cdbf4e97fb4d3bdbb32d5b0c02b75f80ba72 (patch)
treed2e3774ba99a94a2ea571cdb956984e88a71b386 /cps-service/src
parentda0192e77e40239a1f3ffb3d71dcf958e6e7cc8f (diff)
Populate Dataspace field of DataNode
Issue-ID: CPS-1603 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I85aca8bccc28d36aa4cefa0a32cb9bdf2156618a
Diffstat (limited to 'cps-service/src')
-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 6fc36ebb61..e212933388 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,7 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2021 Pantheon.tech
- * Modifications Copyright (C) 2022 Nordix Foundation.
+ * Modifications Copyright (C) 2022-2023 Nordix Foundation.
* Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (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 dataspaceName;
private String anchorName;
/**
@@ -90,6 +91,17 @@ public class DataNodeBuilder {
}
/**
+ * To use dataspace name for creating {@link DataNode}.
+ *
+ * @param dataspaceName dataspace name for the data node
+ * @return DataNodeBuilder
+ */
+ public DataNodeBuilder withDataspace(final String dataspaceName) {
+ this.dataspaceName = dataspaceName;
+ return this;
+ }
+
+ /**
* To use anchor name for creating {@link DataNode}.
*
* @param anchorName anchor name for the data node
@@ -165,6 +177,7 @@ public class DataNodeBuilder {
dataNode.setModuleNamePrefix(moduleNamePrefix);
dataNode.setLeaves(leaves);
dataNode.setChildDataNodes(childDataNodes);
+ dataNode.setDataspace(dataspaceName);
dataNode.setAnchorName(anchorName);
return dataNode;
}