Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 1 | /*Copyright 2016.year Open Networking Laboratory |
| 2 | |
| 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | you may not use this file except in compliance with the License. |
| 5 | You may obtain a copy of the License at |
| 6 | |
| 7 | http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | |
| 9 | Unless required by applicable law or agreed to in writing, software |
| 10 | distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | See the License for the specific language governing permissions and |
| 13 | limitations under the License.*/ |
| 14 | package org.onosproject.yangutils.datamodel; |
| 15 | |
| 16 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 17 | * Represents single interval information of a range. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 18 | * |
| 19 | * @param <T> range type based on the data type. |
| 20 | */ |
| 21 | public class YangRangeInterval<T extends Comparable<T>> { |
| 22 | |
| 23 | /** |
| 24 | * Starting value of the range interval. |
| 25 | */ |
| 26 | private T startValue; |
| 27 | |
| 28 | /** |
| 29 | * Last value of the range interval. |
| 30 | */ |
| 31 | private T endValue; |
| 32 | |
| 33 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 34 | * Creates YANG range interval object. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 35 | */ |
| 36 | public YangRangeInterval() { |
| 37 | } |
| 38 | |
| 39 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 40 | * Returns the starting value of the range interval. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 41 | * |
| 42 | * @return the starting value of the range interval. |
| 43 | */ |
| 44 | public T getStartValue() { |
| 45 | return startValue; |
| 46 | } |
| 47 | |
| 48 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 49 | * Sets the starting value of the range interval. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 50 | * |
| 51 | * @param startValue the starting value of the range interval. |
| 52 | */ |
| 53 | public void setStartValue(T startValue) { |
| 54 | this.startValue = startValue; |
| 55 | } |
| 56 | |
| 57 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 58 | * Returns the last value of the range interval. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 59 | * |
| 60 | * @return last value of the range interval. |
| 61 | */ |
| 62 | public T getEndValue() { |
| 63 | return endValue; |
| 64 | } |
| 65 | |
| 66 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 67 | * Sets the last value of the range interval. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 68 | * |
| 69 | * @param endValue last value of the range interval. |
| 70 | */ |
| 71 | public void setEndValue(T endValue) { |
| 72 | this.endValue = endValue; |
| 73 | } |
| 74 | |
| 75 | } |