Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 18 | package org.onosproject.ui.topo; |
| 19 | |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 20 | import java.util.Collections; |
| 21 | import java.util.HashSet; |
| 22 | import 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 | */ |
| 29 | public class Highlights { |
| 30 | |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 31 | 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 | } |