Hyunsun Moon | 4c39663 | 2016-05-13 04:17:53 -0700 | [diff] [blame] | 1 | /* |
| 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 | package org.onosproject.xosclient.api; |
| 17 | |
| 18 | import com.google.common.base.Strings; |
| 19 | import org.onlab.util.Identifier; |
| 20 | |
| 21 | import static com.google.common.base.Preconditions.checkArgument; |
| 22 | |
| 23 | /** |
| 24 | * Representation of VTN port ID. |
| 25 | */ |
| 26 | public final class VtnPortId extends Identifier<String> { |
| 27 | |
| 28 | private VtnPortId(String id) { |
| 29 | super(id); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Returns vtn port identifier with value. |
| 34 | * |
| 35 | * @param id id |
| 36 | * @return instance port id |
| 37 | */ |
| 38 | public static VtnPortId of(String id) { |
Hyunsun Moon | 6504099 | 2016-07-27 18:41:34 -0700 | [diff] [blame] | 39 | checkArgument(!Strings.isNullOrEmpty(id), "VTN port ID cannot be null"); |
Hyunsun Moon | 4c39663 | 2016-05-13 04:17:53 -0700 | [diff] [blame] | 40 | return new VtnPortId(id); |
| 41 | } |
| 42 | } |