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 {
18 private final QName qname;
20 protected Set<DataSchemaNode> childNodes;
21 protected final Set<DataSchemaNodeBuilder> addedChildNodes = new HashSet<DataSchemaNodeBuilder>();
23 protected Set<GroupingDefinition> groupings;
24 protected final Set<GroupingBuilder> addedGroupings = new HashSet<GroupingBuilder>();
26 protected AbstractDataNodeContainerBuilder(QName qname) {
31 public QName getQName() {
36 public Set<DataSchemaNode> getChildNodes() {
41 public Set<DataSchemaNodeBuilder> getChildNodeBuilders() {
42 return addedChildNodes;
46 public void addChildNode(DataSchemaNodeBuilder childNode) {
47 addedChildNodes.add(childNode);
50 public void setChildNodes(Set<DataSchemaNode> childNodes) {
51 this.childNodes = childNodes;
55 public Set<GroupingDefinition> getGroupings() {
59 public Set<GroupingBuilder> getGroupingBuilders() {
60 return addedGroupings;
64 public void addGrouping(GroupingBuilder grouping) {
65 addedGroupings.add(grouping);
68 public void setGroupings(final Set<GroupingDefinition> groupings) {
69 this.groupings = groupings;