X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fspi%2Fmodel%2FDataNodeBuilder.java;fp=cps-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fspi%2Fmodel%2FDataNodeBuilder.java;h=6fc36ebb61ccac340a0e5bc411d57b3d486fc5d8;hb=a317890387fdbc689f8dcd8648b5bfe3b43abd1e;hp=b23cdfc8d15820ef15cc85e1d60f5a3d906f1659;hpb=0b00f81b98e5fa9632b1145e49f62d0b2712f4e4;p=cps.git 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 leaves = Collections.emptyMap(); private Collection childDataNodes = Collections.emptySet(); + private String anchorName; /** * To use parent node xpath for creating {@link DataNode}. @@ -88,6 +89,17 @@ public class DataNodeBuilder { return this; } + /** + * 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}. * @@ -153,6 +165,7 @@ public class DataNodeBuilder { dataNode.setModuleNamePrefix(moduleNamePrefix); dataNode.setLeaves(leaves); dataNode.setChildDataNodes(childDataNodes); + dataNode.setAnchorName(anchorName); return dataNode; }