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