blob: 718c446b49837d11a9afdd001fb5c0c755241281 [file] [log] [blame]
Phaneendra Mandaefb38752015-12-04 00:43:38 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Phaneendra Mandaefb38752015-12-04 00:43:38 +05303 *
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 */
16package org.onosproject.net;
17
Jian Lib6d998e2016-02-29 11:41:18 -080018import org.onlab.util.Identifier;
Phaneendra Mandaefb38752015-12-04 00:43:38 +053019
20/*
21 * Representation of NSH Service path Identifier
22 */
Jian Lib6d998e2016-02-29 11:41:18 -080023public final class NshServicePathId extends Identifier<Integer> {
Phaneendra Mandaefb38752015-12-04 00:43:38 +053024
25 /**
26 * Default constructor.
27 *
28 * @param servicePathId nsh service path identifier
29 */
30 private NshServicePathId(int servicePathId) {
Jian Lib6d998e2016-02-29 11:41:18 -080031 super(servicePathId);
Phaneendra Mandaefb38752015-12-04 00:43:38 +053032 }
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 Mandaefb38752015-12-04 00:43:38 +053044 /**
45 * Returns nsh context service path identifier.
46 *
47 * @return the nsh context service path id
48 */
49 public int servicePathId() {
Jian Lib6d998e2016-02-29 11:41:18 -080050 return identifier;
Phaneendra Mandaefb38752015-12-04 00:43:38 +053051 }
52}
53