BUG-865: deprecate pre-Beryllium parser elements
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / ConstraintsBuilder.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.Set;
11 import org.opendaylight.yangtools.concepts.Builder;
12 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
13 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
14
15 /**
16  * @deprecated Pre-Beryllium implementation, scheduled for removal.
17  */
18 @Deprecated
19 public interface ConstraintsBuilder extends Builder<ConstraintDefinition> {
20
21     /**
22      * Returns module name in which constraint is defined.
23      *
24      * @return module name
25      */
26     String getModuleName();
27
28     /**
29      *
30      * Return line on which constraints were defined.
31      *
32      * @return line
33      */
34     int getLine();
35
36     /**
37      *
38      * Returns number of minimum required elements.
39      *
40      * This constraint has meaning only if associated node is list or leaf-list.
41      *
42      * @return number of minimum required elements.
43      */
44     Integer getMinElements();
45
46     /**
47      *
48      * Sets number of minimum required elements.
49      *
50      * This constraint has meaning only if associated node is list or leaf-list.
51      *
52      * @param minElements
53      *            number of minimum required elements.
54      */
55     void setMinElements(Integer minElements);
56
57     /**
58      *
59      * Returns number of maximum required elements.
60      *
61      * This constraint has meaning only if associated node is list or leaf-list.
62      *
63      * @return number of maximum required elements.
64      */
65     Integer getMaxElements();
66
67     /**
68      *
69      * Sets number of maximum required elements.
70      *
71      * This constraint has meaning only if associated node is list or leaf-list.
72      *
73      * @param maxElements
74      *            number of maximum required elements.
75      */
76     void setMaxElements(Integer maxElements);
77
78     /**
79      * Returns <code>must</code> definition associated with this builder.
80      *
81      * @return <code>must</code> definition associated with this builder.
82      */
83     Set<MustDefinition> getMustDefinitions();
84
85     /**
86      * Adds must definition to product of this builder.
87      *
88      * @param must
89      *            <code>must</code> definition which should be associated with
90      *            parent node.
91      */
92     void addMustDefinition(MustDefinition must);
93
94     /**
95      * Returns when condition associated with this constraints.
96      *
97      * @return when condition associated with this constraints.
98      */
99     String getWhenCondition();
100
101     /**
102      * Sets when condition associated with this constraints.
103      *
104      * @param whenCondition
105      *            when condition.
106      */
107     void addWhenCondition(String whenCondition);
108
109     /**
110      * Returns true if associated node is mandatory.
111      *
112      *
113      * @return true if associated node is mandatory.
114      */
115     boolean isMandatory();
116
117     /**
118      * Sets mandatory status of parent node
119      *
120      * @param mandatory mandatory status
121      */
122     void setMandatory(boolean mandatory);
123
124     /**
125      * Build constraint definition
126      *
127      * @return instance of ConstraintDefinition created from this builder
128      *
129      * @deprecated Use {@link #build()} instead
130      */
131     @Deprecated
132     ConstraintDefinition toInstance();
133 }