Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 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. |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | package org.onosproject.ui.topo; |
| 18 | |
| 19 | /** |
| 20 | * Parent class of {@link DeviceHighlight} and {@link HostHighlight}. |
| 21 | */ |
| 22 | public abstract class NodeHighlight extends AbstractHighlight { |
Simon Hunt | 8589757 | 2015-10-20 16:29:51 -0700 | [diff] [blame] | 23 | |
| 24 | private NodeBadge badge; |
| 25 | |
| 26 | /** |
| 27 | * Constructs a node highlight entity. |
| 28 | * |
| 29 | * @param type element type |
| 30 | * @param elementId element identifier |
| 31 | */ |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 32 | public NodeHighlight(TopoElementType type, String elementId) { |
| 33 | super(type, elementId); |
| 34 | } |
Simon Hunt | 8589757 | 2015-10-20 16:29:51 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Sets the badge for this node. |
| 38 | * |
| 39 | * @param badge badge to apply |
| 40 | */ |
| 41 | public void setBadge(NodeBadge badge) { |
| 42 | this.badge = badge; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Returns the badge for this node, if any. |
| 47 | * |
| 48 | * @return badge, or null |
| 49 | */ |
| 50 | public NodeBadge badge() { |
| 51 | return badge; |
| 52 | } |
Simon Hunt | 94f7dae | 2015-08-26 17:40:59 -0700 | [diff] [blame] | 53 | } |