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
7 package org.opendaylight.yangtools.yang.parser.builder.api;
10 import org.opendaylight.yangtools.concepts.Builder;
11 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
12 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
14 public interface ConstraintsBuilder extends Builder<ConstraintDefinition> {
17 * Returns module name in which constraint is defined.
21 String getModuleName();
25 * Return line on which constraints were defined.
33 * Returns number of minimum required elements.
35 * This constraint has meaning only if associated node is list or leaf-list.
37 * @return number of minimum required elements.
39 Integer getMinElements();
43 * Sets number of minimum required elements.
45 * This constraint has meaning only if associated node is list or leaf-list.
48 * number of minimum required elements.
50 void setMinElements(Integer minElements);
54 * Returns number of maximum required elements.
56 * This constraint has meaning only if associated node is list or leaf-list.
58 * @return number of maximum required elements.
60 Integer getMaxElements();
64 * Sets number of maximum required elements.
66 * This constraint has meaning only if associated node is list or leaf-list.
69 * number of maximum required elements.
71 void setMaxElements(Integer maxElements);
74 * Returns <code>must</code> definition associated with this builder.
76 * @return <code>must</code> definition associated with this builder.
78 Set<MustDefinition> getMustDefinitions();
81 * Adds must definition to product of this builder.
84 * <code>must</code> definition which should be associated with
87 void addMustDefinition(MustDefinition must);
90 * Returns when condition associated with this constraints.
92 * @return when condition associated with this constraints.
94 String getWhenCondition();
97 * Sets when condition associated with this constraints.
99 * @param whenCondition
102 void addWhenCondition(String whenCondition);
105 * Returns true if associated node is mandatory.
108 * @return true if associated node is mandatory.
110 boolean isMandatory();
113 * Sets mandatory status of parent node
117 void setMandatory(boolean mandatory);
120 * Build constraint definition
124 ConstraintDefinition toInstance();