71e24bcf829ac8ca8349ec722b648da04e932275
[controller.git] / AbstractChildNodeBuilder.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.yang.model.parser.builder.api;
9
10 import java.util.HashSet;
11 import java.util.Set;
12
13 import org.opendaylight.controller.yang.common.QName;
14
15 public abstract class AbstractChildNodeBuilder implements ChildNodeBuilder {
16
17     private final QName qname;
18     protected final Set<DataSchemaNodeBuilder> childNodes = new HashSet<DataSchemaNodeBuilder>();
19     protected final Set<GroupingBuilder> groupings = new HashSet<GroupingBuilder>();
20
21     protected AbstractChildNodeBuilder(QName qname) {
22         this.qname = qname;
23     }
24
25     @Override
26     public QName getQName() {
27         return qname;
28     }
29
30     @Override
31     public void addChildNode(DataSchemaNodeBuilder childNode) {
32         childNodes.add(childNode);
33     }
34
35     @Override
36     public void addGrouping(GroupingBuilder grouping) {
37         groupings.add(grouping);
38     }
39
40 }