BUG-865: deprecate pre-Beryllium parser elements
[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  * @deprecated Pre-Beryllium implementation, scheduled for removal.
21  */
22 @Deprecated
23 public interface TypeDefinitionBuilder extends TypeAwareBuilder, SchemaNodeBuilder, GroupingMember {
24
25     /**
26      * Sets QName for resulting type definition.
27      *
28      * @param qname QName of resulting type
29      */
30     void setQName(QName qname);
31
32     @Override
33     TypeDefinition<?> build();
34
35     /**
36      *
37      * Returns range restrictions of resulting type definition.
38      *
39      * @return range restrictions of resulting type definition.
40      */
41     List<RangeConstraint> getRanges();
42
43     /**
44      * Set Range restrictions for resulting type definition.
45      *
46      * @param ranges
47      *            Range restrictions of resulting type definition.
48      */
49     void setRanges(List<RangeConstraint> ranges);
50
51     /**
52      *
53      * Returns length restrictions of resulting type definition.
54      *
55      * @return length restrictions of resulting type definition.
56      */
57     List<LengthConstraint> getLengths();
58
59     /**
60      * Set length restrictions for resulting type definition.
61      *
62      * @param lengths
63      *            Length restrictions of resulting type definition.
64      */
65     void setLengths(List<LengthConstraint> lengths);
66
67     /**
68      *
69      * Returns pattern restrictions of resulting type definition.
70      *
71      * @return range restrictions of resulting type definition.
72      */
73     List<PatternConstraint> getPatterns();
74
75     /**
76      * Set pattern restrictions for resulting type definition.
77      *
78      * @param patterns
79      *            patterns restrictions of resulting type definition.
80      */
81     void setPatterns(List<PatternConstraint> patterns);
82
83     /**
84      *
85      * Returns fractions digits of resulting type if it is derived
86      * from <code>decimal</code> built-in type.
87      *
88      * @return fractions digits of resulting type
89      */
90     Integer getFractionDigits();
91
92     /**
93      * Sets fractions digits of resulting type if it is derived from
94      * <code>decimal</code> built-in type.
95      *
96      * @param fractionDigits fraction digits
97      */
98     void setFractionDigits(Integer fractionDigits);
99
100     /**
101      *
102      * Returns default value of resulting type
103      *
104      * @return default value of resulting type
105      */
106     Object getDefaultValue();
107
108     /**
109      *
110      * Sets default value of resulting type
111      *
112      * @param defaultValue Default value of resulting type
113      */
114     void setDefaultValue(Object defaultValue);
115
116     /**
117      * Gets unit definition for resulting type
118      *
119      * @return unit definition for resulting type
120      */
121     String getUnits();
122
123     /**
124      * Sets units definition for resulting type
125      *
126      * @param units units definition for resulting type
127      */
128     void setUnits(String units);
129
130 }