API Clarity: Documented o.o.y.yang.parser.builder.api
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / TypeDefinitionBuilder.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
3  * This program and the accompanying materials are made available under the
4  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
5  * and is available at http://www.eclipse.org/legal/epl-v10.html
6  */
7 package org.opendaylight.yangtools.yang.parser.builder.api;
8
9 import java.util.List;
10
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
13 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
14 import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
15 import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
16
17 /**
18  * Interface for builders of 'typedef' statement.
19  */
20 public interface TypeDefinitionBuilder extends TypeAwareBuilder, SchemaNodeBuilder, GroupingMember {
21
22     /**
23      * Sets QName for resulting type definition.
24      *
25      * @param qname QName of resulting type
26      */
27     void setQName(QName qname);
28
29     @Override
30     TypeDefinition<?> build();
31
32     /**
33      *
34      * Returns range restrictions of resulting type definition.
35      *
36      * @return range restrictions of resulting type definition.
37      */
38     List<RangeConstraint> getRanges();
39
40     /**
41      * Set Range restrictions for resulting type definition.
42      *
43      * @param ranges
44      *            Range restrictions of resulting type definition.
45      */
46     void setRanges(List<RangeConstraint> ranges);
47
48     /**
49      *
50      * Returns length restrictions of resulting type definition.
51      *
52      * @return length restrictions of resulting type definition.
53      */
54     List<LengthConstraint> getLengths();
55
56     /**
57      * Set length restrictions for resulting type definition.
58      *
59      * @param lengths
60      *            Length restrictions of resulting type definition.
61      */
62     void setLengths(List<LengthConstraint> lengths);
63
64     /**
65      *
66      * Returns pattern restrictions of resulting type definition.
67      *
68      * @return range restrictions of resulting type definition.
69      */
70     List<PatternConstraint> getPatterns();
71
72     /**
73      * Set length restrictions for resulting type definition.
74      *
75      * @param lengths
76      *            Length restrictions of resulting type definition.
77      */
78     void setPatterns(List<PatternConstraint> patterns);
79
80     /**
81      *
82      * Returns fractions digits of resulting type if it is derived
83      * from <code>decimal</code> built-in type.
84      *
85      * @return fractions digits of resulting type
86      */
87     Integer getFractionDigits();
88
89     /**
90      *
91      * Sets fractions digits of resulting type if it is derived
92      * from <code>decimal</code> built-in type.
93      *
94      * @return fractions digits of resulting type
95      */
96     void setFractionDigits(Integer fractionDigits);
97
98     /**
99      *
100      * Returns default value of resulting type
101      *
102      * @return default value of resulting type
103      */
104     Object getDefaultValue();
105
106     /**
107      *
108      * Sets default value of resulting type
109      *
110      * @param defaultValue Default value of resulting type
111      */
112     void setDefaultValue(Object defaultValue);
113
114     /**
115      * Gets unit definition for resulting type
116      *
117      * @return unit definition for resulting type
118      */
119     String getUnits();
120
121     /**
122      * Sets units definition for resulting type
123      *
124      * @param units units definition for resulting type
125      */
126     void setUnits(String units);
127
128 }