blob: 6f255c6090a77cb5b70fa449968eb91110a70ffb [file] [log] [blame]
Naoki Shiota5a056062016-05-05 18:43:59 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Naoki Shiota5a056062016-05-05 18:43:59 -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.newoptical.api;
17
18import com.google.common.annotations.Beta;
19import com.google.common.base.MoreObjects;
20import org.onlab.util.Identifier;
Naoki Shiotacb744db2016-05-13 19:32:35 -070021import org.onosproject.net.resource.ResourceConsumer;
22import org.onosproject.net.resource.ResourceConsumerId;
Naoki Shiota5a056062016-05-05 18:43:59 -070023
24// TODO: After ResourceManager is made to accept app-defined ResourceConsumer,
25// this class should be implemented as ResourceConsumer.
26/**
27 * ID for optical connectivity.
28 */
29@Beta
Naoki Shiotacb744db2016-05-13 19:32:35 -070030public final class OpticalConnectivityId extends Identifier<Long> implements ResourceConsumer {
Naoki Shiota5a056062016-05-05 18:43:59 -070031
32 public static OpticalConnectivityId of(long value) {
33 return new OpticalConnectivityId(value);
34 }
35
36 OpticalConnectivityId(long value) {
37 super(value);
38 }
39
40 @Override
Naoki Shiotacb744db2016-05-13 19:32:35 -070041 public ResourceConsumerId consumerId() {
42 return ResourceConsumerId.of(this);
43 }
44
45 @Override
Naoki Shiota5a056062016-05-05 18:43:59 -070046 public String toString() {
47 return MoreObjects.toStringHelper(this)
48 .add("value", id())
49 .toString();
50 }
51}