Propagate @NonNull collection annotations
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / RangeConstraint.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.api.type;
9
10 import com.google.common.collect.RangeSet;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.model.api.ConstraintMetaDefinition;
13
14 /**
15  * A single value range restriction, as expressed by a range statement, as specified by
16  * <a href="https://tools.ietf.org/html/rfc6020#section-9.2.4">[RFC-6020] The range Statement</a>.
17  */
18 public interface RangeConstraint<T extends Number & Comparable<T>> extends ConstraintMetaDefinition {
19     /**
20      * Return allowed length ranges. Returned RangeSet must not be empty.
21      *
22      * @return Set of allowed lengths.
23      */
24     RangeSet<@NonNull T> getAllowedRanges();
25 }