blob: 6fc4a43c427b27092d669b0b27e3d5dfcee66ce0 [file] [log] [blame]
Hyunsun Moon4c396632016-05-13 04:17:53 -07001/*
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 */
16package org.onosproject.xosclient.api;
17
Hyunsun Moon65040992016-07-27 18:41:34 -070018import com.google.common.base.Strings;
Hyunsun Moon4c396632016-05-13 04:17:53 -070019import org.onlab.util.Identifier;
20
Hyunsun Moon65040992016-07-27 18:41:34 -070021import static com.google.common.base.Preconditions.checkArgument;
Hyunsun Moon4c396632016-05-13 04:17:53 -070022
23/**
24 * Representation of VTN service identifier.
25 */
26public 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 Moon65040992016-07-27 18:41:34 -070043 checkArgument(!Strings.isNullOrEmpty(id), "VTN service ID cannot be null");
Hyunsun Moon4c396632016-05-13 04:17:53 -070044 return new VtnServiceId(id);
45 }
46}