*/
package org.opendaylight.yangtools.yang.model.api.type;
+import com.google.common.collect.RangeSet;
import org.opendaylight.yangtools.yang.model.api.ConstraintMetaDefinition;
/**
- * The Lenght Constraint value consists of an explicit value, or a lower bound
- * returned by {@link #getMin()} and an upper bound returned by
- * {@link #getMax()}. <br>
- * <br>
- * Length-restricting values MUST NOT be negative. A length value is a
- * non-negative integer, or one of the special values <code>min</code> or
- * <code>max</code>. The defined <code>min</code> and <code>max</code> mean the
- * minimum and maximum length accepted for the type being restricted,
- * respectively. <br>
- * An implementation is not required to support a length value larger than
- * {@link Long#MAX_VALUE} <br>
- * <br>
- * The interface extends definitions from {@link ConstraintMetaDefinition} <br>
- * <br>
- * This interface was modeled according to definition in <a
- * href="https://tools.ietf.org/html/rfc6020#section-9.4.4">[RFC-6020] The
- * length Statement</a>.
- *
- * @see ConstraintMetaDefinition
+ * A single value length restriction, as expressed by a length statement, as specified by
+ * <a href="https://tools.ietf.org/html/rfc6020#section-9.4.4">[RFC-6020] The length Statement</a>.
*/
public interface LengthConstraint extends ConstraintMetaDefinition {
-
- /**
- * Returns the length-restricting lower bound value. <br>
- * The value MUST NOT be negative.
- *
- * @return the length-restricting lower bound value.
- */
- Number getMin();
-
/**
- * Returns the length-restricting upper bound value. <br>
- * The value MUST NOT be negative.
+ * Return allowed length ranges. Returned RangeSet must not be empty.
*
- * @return length-restricting upper bound value.
+ * @return Set of allowed lengths.
*/
- Number getMax();
+ RangeSet<Integer> getAllowedRanges();
}