Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.flow; |
Ayaka Koshibe | 414196d | 2014-09-17 13:46:43 -0700 | [diff] [blame] | 17 | |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame^] | 18 | import org.onlab.util.Identifier; |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 19 | |
Ayaka Koshibe | 414196d | 2014-09-17 13:46:43 -0700 | [diff] [blame] | 20 | /** |
| 21 | * Representation of a Flow ID. |
| 22 | */ |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame^] | 23 | public final class FlowId extends Identifier<Long> { |
Ayaka Koshibe | 414196d | 2014-09-17 13:46:43 -0700 | [diff] [blame] | 24 | |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 25 | private FlowId(long id) { |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame^] | 26 | super(id); |
Ayaka Koshibe | 414196d | 2014-09-17 13:46:43 -0700 | [diff] [blame] | 27 | } |
| 28 | |
alshabib | 9290eea | 2014-09-22 11:58:17 -0700 | [diff] [blame] | 29 | public static FlowId valueOf(long id) { |
Ayaka Koshibe | 414196d | 2014-09-17 13:46:43 -0700 | [diff] [blame] | 30 | return new FlowId(id); |
| 31 | } |
| 32 | |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 33 | public long value() { |
Jian Li | b6d998e | 2016-02-29 11:41:18 -0800 | [diff] [blame^] | 34 | return this.identifier; |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 35 | } |
Ayaka Koshibe | 414196d | 2014-09-17 13:46:43 -0700 | [diff] [blame] | 36 | } |