blob: 848e758353028de830111e3d299961e4412e4db1 [file] [log] [blame]
Simon Hunta17fa672015-08-19 18:42:22 -07001/*
2 * Copyright 2015 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 */
17
18package org.onosproject.ui.topo;
19
Simon Hunta17fa672015-08-19 18:42:22 -070020import java.util.Collections;
21import java.util.HashSet;
22import java.util.Set;
23
24/**
25 * Encapsulates highlights to be applied to the topology view, such as
26 * highlighting links, displaying link labels, perhaps even decorating
27 * nodes with badges, etc.
28 */
29public class Highlights {
30
Simon Hunta17fa672015-08-19 18:42:22 -070031 private final Set<DeviceHighlight> devices = new HashSet<>();
32 private final Set<HostHighlight> hosts = new HashSet<>();
33 private final Set<LinkHighlight> links = new HashSet<>();
34
35
36 public Highlights add(DeviceHighlight d) {
37 devices.add(d);
38 return this;
39 }
40
41 public Highlights add(HostHighlight h) {
42 hosts.add(h);
43 return this;
44 }
45
46 public Highlights add(LinkHighlight lh) {
47 links.add(lh);
48 return this;
49 }
50
51
52 public Set<DeviceHighlight> devices() {
53 return Collections.unmodifiableSet(devices);
54 }
55
56 public Set<HostHighlight> hosts() {
57 return Collections.unmodifiableSet(hosts);
58 }
59
60 public Set<LinkHighlight> links() {
61 return Collections.unmodifiableSet(links);
62 }
63}