blob: 7578547d624fda413d7498309868f6563178cee8 [file] [log] [blame]
Gaurav Agrawal72cd1b72016-06-30 13:28:14 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yangutils.datamodel.utils.builtindatatype;
18
19import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DECIMAL64;
20import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT16;
21import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32;
22import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64;
23import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT8;
24import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT16;
25import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT32;
26import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT64;
27import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT8;
28
29/**
30 * Represents YANG data type utilities.
31 */
32public final class YangDataTypeUtils {
33
34 /**
35 * Restricts creation of YANG data type utils instance.
36 */
37 private YangDataTypeUtils() {
38 }
39
40 /**
41 * Returns whether the data type is of range restricted type.
42 *
43 * @param dataType data type to be checked
44 * @return true, if data type can have range restrictions, false otherwise
45 */
46 public static boolean isOfRangeRestrictedType(YangDataTypes dataType) {
47 return dataType == INT8
48 || dataType == INT16
49 || dataType == INT32
50 || dataType == INT64
51 || dataType == UINT8
52 || dataType == UINT16
53 || dataType == UINT32
54 || dataType == UINT64
55 || dataType == DECIMAL64;
56 }
57}