2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.parser.builder.api;
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;
16 * @deprecated Pre-Beryllium implementation, scheduled for removal.
19 public interface ConstraintsBuilder extends Builder<ConstraintDefinition> {
22 * Returns module name in which constraint is defined.
26 String getModuleName();
30 * Return line on which constraints were defined.
38 * Returns number of minimum required elements.
40 * This constraint has meaning only if associated node is list or leaf-list.
42 * @return number of minimum required elements.
44 Integer getMinElements();
48 * Sets number of minimum required elements.
50 * This constraint has meaning only if associated node is list or leaf-list.
53 * number of minimum required elements.
55 void setMinElements(Integer minElements);
59 * Returns number of maximum required elements.
61 * This constraint has meaning only if associated node is list or leaf-list.
63 * @return number of maximum required elements.
65 Integer getMaxElements();
69 * Sets number of maximum required elements.
71 * This constraint has meaning only if associated node is list or leaf-list.
74 * number of maximum required elements.
76 void setMaxElements(Integer maxElements);
79 * Returns <code>must</code> definition associated with this builder.
81 * @return <code>must</code> definition associated with this builder.
83 Set<MustDefinition> getMustDefinitions();
86 * Adds must definition to product of this builder.
89 * <code>must</code> definition which should be associated with
92 void addMustDefinition(MustDefinition must);
95 * Returns when condition associated with this constraints.
97 * @return when condition associated with this constraints.
99 String getWhenCondition();
102 * Sets when condition associated with this constraints.
104 * @param whenCondition
107 void addWhenCondition(String whenCondition);
110 * Returns true if associated node is mandatory.
113 * @return true if associated node is mandatory.
115 boolean isMandatory();
118 * Sets mandatory status of parent node
120 * @param mandatory mandatory status
122 void setMandatory(boolean mandatory);
125 * Build constraint definition
127 * @return instance of ConstraintDefinition created from this builder
129 * @deprecated Use {@link #build()} instead
132 ConstraintDefinition toInstance();