97f4448f57cde5c347616aa90afd88342bd32139
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-api / src / main / java / org / opendaylight / controller / model / api / type / LengthConstraint.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 Lenght Constraint value consists of an explicit value, or a lower bound\r
14  * returned by {@link #getMin()} and an upper bound returned by\r
15  * {@link #getMax()}. <br>\r
16  * <br>\r
17  * Length-restricting values MUST NOT be negative. A length value is a\r
18  * non-negative integer, or one of the special values <code>min</code> or\r
19  * <code>max</code>. The defined <code>min</code> and <code>max</code> mean the\r
20  * minimum and maximum length accepted for the type being restricted,\r
21  * respectively. <br>\r
22  * An implementation is not required to support a length value larger than\r
23  * {@link Long#MAX_VALUE} <br>\r
24  * <br>\r
25  * The interface extends definitions from {@link ConstraintMetaDefinition} <br>\r
26  * <br>\r
27  * This interface was modeled according to definition in <a\r
28  * href="https://tools.ietf.org/html/rfc6020#section-9.4.4">[RFC-6020] The\r
29  * length Statement</a>.\r
30  * \r
31  * @see ConstraintMetaDefinition\r
32  */\r
33 public interface LengthConstraint extends ConstraintMetaDefinition {\r
34 \r
35     /**\r
36      * Returns the length-restricting lower bound value. <br>\r
37      * The value MUST NOT be negative.\r
38      * \r
39      * @return the length-restricting lower bound value.\r
40      */\r
41     Long getMin();\r
42 \r
43     /**\r
44      * Returns the length-restricting upper bound value. <br>\r
45      * The value MUST NOT be negative.\r
46      * \r
47      * @return length-restricting upper bound value.\r
48      */\r
49     Long getMax();\r
50 }\r