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