12fbb1bcd5728e3ee96b53fdaaa7a6c0384eac98
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-api / src / main / java / org / opendaylight / controller / model / api / type / RangeConstraint.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.controller.model.api.type;\r
9 \r
10 import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;\r
11 \r
12 /**\r
13  * The Range Constraint interface is used to restrict integer and decimal\r
14  * built-in types, or types derived from those.\r
15  * <br>\r
16  * A range consists of an explicit value consists of an explicit value, or a lower bound\r
17  * returned by {@link #getMin()} and an upper bound returned by\r
18  * {@link #getMax()}. <br>\r
19  * <br>\r
20  * Each explicit value and range boundary value given in\r
21  * the range expression MUST match the type being restricted, or be one of the\r
22  * special values "min" or "max". "min" and "max" mean the minimum and maximum\r
23  * value accepted for the type being restricted, respectively\r
24  * <br>\r
25  * <br>\r
26  * This interface was modeled according to definition in <a\r
27  * href="https://tools.ietf.org/html/rfc6020#section-9.2.4">[RFC-6020] The\r
28  * range Statement</a>.\r
29  */\r
30 public interface RangeConstraint extends ConstraintMetaDefinition {\r
31 \r
32     /**\r
33      * Returns the length-restricting lower bound value.\r
34      * \r
35      * @return the length-restricting lower bound value.\r
36      */\r
37     Number getMin();\r
38 \r
39     /**\r
40      * Returns the length-restricting upper bound value.\r
41      * \r
42      * @return the length-restricting upper bound value.\r
43      */\r
44     Number getMax();\r
45 }\r