blob: 389f42b48b4f3a2bfa9063ffb9fe3e6b749445d2 [file] [log] [blame]
HIGUCHI Yuta34a3f692016-01-09 21:08:57 -08001/*
2 * Copyright 2016 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.net.optical.utils;
17
18import org.onlab.packet.ChassisId;
19import org.onosproject.net.Annotations;
20import org.onosproject.net.Device;
21import org.onosproject.net.DeviceId;
22import org.onosproject.net.driver.Behaviour;
23import org.onosproject.net.provider.ProviderId;
24
25import com.google.common.annotations.Beta;
26
27/**
28 * A Device which forwards all its method calls to another Device.
29 */
30@Beta
31public interface ForwardingDevice extends Device {
32
33 Device delegate();
34
35 @Override
36 default Annotations annotations() {
37 return delegate().annotations();
38 }
39
40 @Override
41 default ProviderId providerId() {
42 return delegate().providerId();
43 }
44
45 @Override
46 default <B extends Behaviour> B as(Class<B> projectionClass) {
47 return delegate().as(projectionClass);
48 }
49
50 @Override
51 default DeviceId id() {
52 return delegate().id();
53 }
54
55 @Override
56 default Type type() {
57 return delegate().type();
58 }
59
60 @Override
61 default <B extends Behaviour> boolean is(Class<B> projectionClass) {
62 return delegate().is(projectionClass);
63 }
64
65 @Override
66 default String manufacturer() {
67 return delegate().manufacturer();
68 }
69
70 @Override
71 default String hwVersion() {
72 return delegate().hwVersion();
73 }
74
75 @Override
76 default String swVersion() {
77 return delegate().swVersion();
78 }
79
80 @Override
81 default String serialNumber() {
82 return delegate().serialNumber();
83 }
84
85 @Override
86 default ChassisId chassisId() {
87 return delegate().chassisId();
88 }
89}