dff64b38cc31924c9ec179f5d32f60e10283762a
[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  *
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.yangtools.yang.parser.builder.api;
9
10 import java.util.List;
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 pattern restrictions for resulting type definition.
74      *
75      * @param patterns
76      *            patterns 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      * Sets fractions digits of resulting type if it is derived from
91      * <code>decimal</code> built-in type.
92      *
93      * @param fractionDigits fraction digits
94      */
95     void setFractionDigits(Integer fractionDigits);
96
97     /**
98      *
99      * Returns default value of resulting type
100      *
101      * @return default value of resulting type
102      */
103     Object getDefaultValue();
104
105     /**
106      *
107      * Sets default value of resulting type
108      *
109      * @param defaultValue Default value of resulting type
110      */
111     void setDefaultValue(Object defaultValue);
112
113     /**
114      * Gets unit definition for resulting type
115      *
116      * @return unit definition for resulting type
117      */
118     String getUnits();
119
120     /**
121      * Sets units definition for resulting type
122      *
123      * @param units units definition for resulting type
124      */
125     void setUnits(String units);
126
127 }