/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2021 Pantheon.tech
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private NormalizedNode<?, ?> normalizedNodeTree;
private String xpath;
+ private Map<String, Object> leaves = Collections.emptyMap();
private Collection<DataNode> childDataNodes = Collections.emptySet();
return this;
}
+ /**
+ * To use attributes for creating {@link DataNode}.
+ *
+ * @param leaves for the data node
+ * @return DataNodeBuilder
+ */
+ public DataNodeBuilder withLeaves(final Map<String, Object> leaves) {
+ this.leaves = leaves;
+ return this;
+ }
+
/**
* To specify child nodes needs to be used while creating {@link DataNode}.
*
private DataNode buildFromAttributes() {
final DataNode dataNode = new DataNode();
dataNode.setXpath(xpath);
+ dataNode.setLeaves(leaves);
dataNode.setChildDataNodes(childDataNodes);
return dataNode;
}