blob: 7e67430fbcfe3df2cda4a3d3accf217964fa1583 [file] [log] [blame]
Simon Huntc13082f2016-08-03 21:20:23 -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 */
16
17package org.onosproject.ui.model.topo;
18
19import org.onosproject.net.region.RegionId;
20
21import static com.google.common.base.MoreObjects.toStringHelper;
22
23/**
24 * A synthetic link that encapsulates a UiLink instance and the region to
25 * which it belongs.
26 */
27public class UiSynthLink {
28
29 private final RegionId regionId;
30 private final UiLink link;
31
32 /**
33 * Constructs a synthetic link with the given parameters.
34 *
35 * @param regionId the region to which the link belongs
36 * @param link the link instance
37 */
38 public UiSynthLink(RegionId regionId, UiLink link) {
39 this.regionId = regionId;
40 this.link = link;
41 }
42
43 @Override
44 public String toString() {
45 return toStringHelper(this)
46 .add("region", regionId)
47 .add("link", link)
48 .toString();
49 }
50
51 /**
52 * Returns the region identifier.
53 *
54 * @return the region ID
55 */
56 public RegionId regionId() {
57 return regionId;
58 }
59
60 /**
61 * Returns the link.
62 *
63 * @return the link
64 */
65 public UiLink link() {
66 return link;
67 }
68}