Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 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 | package org.onosproject.net; |
| 17 | |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame] | 18 | import org.onlab.util.Identifier; |
Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 19 | |
| 20 | /* |
| 21 | * Representation of NSH Service path Identifier |
| 22 | */ |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame] | 23 | public final class NshServicePathId extends Identifier<Integer> { |
Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Default constructor. |
| 27 | * |
| 28 | * @param servicePathId nsh service path identifier |
| 29 | */ |
| 30 | private NshServicePathId(int servicePathId) { |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame] | 31 | super(servicePathId); |
Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Returns the NshServicePathId by setting its value. |
| 36 | * |
| 37 | * @param servicePathId nsh service path identifier |
| 38 | * @return NshServicePathId |
| 39 | */ |
| 40 | public static NshServicePathId of(int servicePathId) { |
| 41 | return new NshServicePathId(servicePathId); |
| 42 | } |
| 43 | |
Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 44 | /** |
| 45 | * Returns nsh context service path identifier. |
| 46 | * |
| 47 | * @return the nsh context service path id |
| 48 | */ |
| 49 | public int servicePathId() { |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame] | 50 | return identifier; |
Phaneendra Manda | efb3875 | 2015-12-04 00:43:38 +0530 | [diff] [blame] | 51 | } |
| 52 | } |
| 53 | |