Added support to generate interfaces from Choices and Cases.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / util / RefineHolder.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.parser.util;
9
10 import java.util.ArrayList;
11 import java.util.List;
12
13 import org.opendaylight.controller.yang.model.api.MustDefinition;
14 import org.opendaylight.controller.yang.parser.builder.api.Builder;
15 import org.opendaylight.controller.yang.parser.builder.api.ConfigNode;
16 import org.opendaylight.controller.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
17
18 public final class RefineHolder implements Builder, ConfigNode {
19     private final String name;
20     private final int line;
21     private String defaultStr;
22     private String description;
23     private String reference;
24     private Boolean config;
25     private Boolean mandatory;
26     private Boolean presence;
27     private MustDefinition must;
28     private Integer minElements;
29     private Integer maxElements;
30     private final List<UnknownSchemaNodeBuilder> addedUnknownNodes = new ArrayList<UnknownSchemaNodeBuilder>();
31
32     public RefineHolder(final String name, final int line) {
33         this.name = name;
34         this.line = line;
35     }
36
37     @Override
38     public int getLine() {
39         return line;
40     }
41
42     public String getDefaultStr() {
43         return defaultStr;
44     }
45
46     public void setDefaultStr(final String defaultStr) {
47         this.defaultStr = defaultStr;
48     }
49
50     public String getDescription() {
51         return description;
52     }
53
54     public void setDescription(final String description) {
55         this.description = description;
56     }
57
58     public String getReference() {
59         return reference;
60     }
61
62     public void setReference(final String reference) {
63         this.reference = reference;
64     }
65
66     @Override
67     public Boolean isConfiguration() {
68         return config;
69     }
70
71     @Override
72     public void setConfiguration(final Boolean config) {
73         this.config = config;
74     }
75
76     public Boolean isMandatory() {
77         return mandatory;
78     }
79
80     public void setMandatory(Boolean mandatory) {
81         this.mandatory = mandatory;
82     }
83
84     public Boolean isPresence() {
85         return presence;
86     }
87
88     public void setPresence(Boolean presence) {
89         this.presence = presence;
90     }
91
92     public MustDefinition getMust() {
93         return must;
94     }
95
96     public void setMust(MustDefinition must) {
97         this.must = must;
98     }
99
100     public Integer getMinElements() {
101         return minElements;
102     }
103
104     public void setMinElements(Integer minElements) {
105         this.minElements = minElements;
106     }
107
108     public Integer getMaxElements() {
109         return maxElements;
110     }
111
112     public void setMaxElements(Integer maxElements) {
113         this.maxElements = maxElements;
114     }
115
116     public String getName() {
117         return name;
118     }
119
120     public List<UnknownSchemaNodeBuilder> getUnknownNodes() {
121         return addedUnknownNodes;
122     }
123
124     public void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode) {
125         addedUnknownNodes.add(unknownNode);
126     }
127
128     @Override
129     public Object build() {
130         return null;
131     }
132
133 }