blob: 514076293603c9dc65d1d7c51db9c7bc9469e55f [file] [log] [blame]
Brian O'Connorb7baf712015-07-28 23:27:03 -07001/*
Thomas Vachuska52f2cd12018-11-08 21:20:04 -08002 * Copyright 2018-present Open Networking Foundation
Brian O'Connorb7baf712015-07-28 23:27:03 -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 */
16package org.onosproject.incubator.net.domain;
17
18import com.google.common.annotations.Beta;
Jian Lib6d998e2016-02-29 11:41:18 -080019import org.onlab.util.Identifier;
Brian O'Connorb7baf712015-07-28 23:27:03 -070020
21import static com.google.common.base.Preconditions.checkNotNull;
22
23/**
24 * Intent domain identifier.
25 */
26@Beta
Jian Lib6d998e2016-02-29 11:41:18 -080027public class IntentDomainId extends Identifier<String> {
Brian O'Connorb7baf712015-07-28 23:27:03 -070028 /**
29 * Creates an intent domain identifier from the specified string representation.
30 *
31 * @param value string value
32 * @return intent identifier
33 */
34 public static IntentDomainId valueOf(String value) {
35 return new IntentDomainId(value);
36 }
37
38 /**
39 * Constructor for serializer.
40 */
41 IntentDomainId() {
Jian Lib6d998e2016-02-29 11:41:18 -080042 super(null);
Brian O'Connorb7baf712015-07-28 23:27:03 -070043 }
44
45 /**
46 * Constructs the ID corresponding to a given string value.
47 *
48 * @param value the underlying value of this ID
49 */
50 IntentDomainId(String value) {
Jian Lib6d998e2016-02-29 11:41:18 -080051 super(checkNotNull(value, "Intent domain ID cannot be null."));
Brian O'Connorb7baf712015-07-28 23:27:03 -070052 }
53}