blob: 738a999ae00ae2d951bd16bc83c00e3dba55ce74 [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
Gaurav Agrawal72cd1b72016-06-30 13:28:14 +053019import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT16;
20import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32;
21import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64;
22import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT8;
23import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT16;
24import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT32;
25import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT64;
26import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT8;
27
28/**
29 * Represents YANG data type utilities.
30 */
31public final class YangDataTypeUtils {
32
33 /**
34 * Restricts creation of YANG data type utils instance.
35 */
36 private YangDataTypeUtils() {
37 }
38
39 /**
40 * Returns whether the data type is of range restricted type.
41 *
42 * @param dataType data type to be checked
43 * @return true, if data type can have range restrictions, false otherwise
44 */
45 public static boolean isOfRangeRestrictedType(YangDataTypes dataType) {
46 return dataType == INT8
47 || dataType == INT16
48 || dataType == INT32
49 || dataType == INT64
50 || dataType == UINT8
51 || dataType == UINT16
52 || dataType == UINT32
Mahesh Poojary Huawei46fb4db2016-07-14 12:38:17 +053053 || dataType == UINT64;
Gaurav Agrawal72cd1b72016-06-30 13:28:14 +053054 }
55}