blob: fa1b51b4bf57c33c5b10b2bd1845d1a79deee614 [file] [log] [blame]
Hyunsun Moon395542a2016-09-01 13:53:08 -07001/*
Brian O'Connor80dff972017-08-03 22:46:30 -07002 * Copyright 2016-present Open Networking Foundation
Hyunsun Moon395542a2016-09-01 13:53:08 -07003 *
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 */
Hyunsun Moonfd5a24e2016-10-19 19:15:48 -070016package org.opencord.cordvtn.api.net;
Hyunsun Moon395542a2016-09-01 13:53:08 -070017
Hyunsun Moon4a94c2e2016-10-21 17:37:05 -070018import com.google.common.base.Strings;
Hyunsun Moon395542a2016-09-01 13:53:08 -070019import org.onlab.util.Identifier;
20
Hyunsun Moon4a94c2e2016-10-21 17:37:05 -070021import static com.google.common.base.Preconditions.checkArgument;
22
Hyunsun Moon395542a2016-09-01 13:53:08 -070023/**
24 * Representation of the network identifier.
25 */
26public final class NetworkId extends Identifier<String> {
27
28 /**
29 * Default constructor.
30 *
31 * @param id string network identifier
32 */
33 private NetworkId(String id) {
34 super(id);
35 }
36
37 /**
38 * Returns the network identifier with the supplied value.
39 *
40 * @param id string network identifier
41 * @return network identifier
42 */
43 public static NetworkId of(String id) {
Hyunsun Moon4a94c2e2016-10-21 17:37:05 -070044 checkArgument(!Strings.isNullOrEmpty(id));
Hyunsun Moon395542a2016-09-01 13:53:08 -070045 return new NetworkId(id);
46 }
47}