2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.yang.parser.builder.api;
10 import java.util.HashSet;
13 import org.opendaylight.controller.yang.common.QName;
14 import org.opendaylight.controller.yang.model.api.DataSchemaNode;
15 import org.opendaylight.controller.yang.model.api.GroupingDefinition;
17 public abstract class AbstractDataNodeContainerBuilder implements DataNodeContainerBuilder {
19 private final QName qname;
21 protected Set<DataSchemaNode> childNodes;
22 protected final Set<DataSchemaNodeBuilder> addedChildNodes = new HashSet<DataSchemaNodeBuilder>();
24 protected Set<GroupingDefinition> groupings;
25 protected final Set<GroupingBuilder> addedGroupings = new HashSet<GroupingBuilder>();
27 protected AbstractDataNodeContainerBuilder(QName qname) {
32 public QName getQName() {
37 public Set<DataSchemaNodeBuilder> getChildNodes() {
38 return addedChildNodes;
42 public void addChildNode(DataSchemaNodeBuilder childNode) {
43 addedChildNodes.add(childNode);
46 public void setChildNodes(Set<DataSchemaNode> childNodes) {
47 this.childNodes = childNodes;
50 public Set<GroupingBuilder> getGroupings() {
51 return addedGroupings;
55 public void addGrouping(GroupingBuilder grouping) {
56 addedGroupings.add(grouping);
59 public void setGroupings(final Set<GroupingDefinition> groupings) {
60 this.groupings = groupings;