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 | d6685d0 | 2015-08-21 09:56:06 -0700 | [diff] [blame^] | 20 | import static com.google.common.base.Preconditions.checkNotNull; |
| 21 | |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 22 | /** |
Simon Hunt | 4fc8685 | 2015-08-20 17:57:52 -0700 | [diff] [blame] | 23 | * Partial implementation of the highlighting to apply to topology |
| 24 | * view elements. |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 25 | */ |
| 26 | public abstract class AbstractHighlight { |
| 27 | private final TopoElementType type; |
| 28 | private final String elementId; |
| 29 | |
Simon Hunt | 4fc8685 | 2015-08-20 17:57:52 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Constructs the highlight. |
| 32 | * |
| 33 | * @param type highlight element type |
| 34 | * @param elementId element identifier |
| 35 | */ |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 36 | public AbstractHighlight(TopoElementType type, String elementId) { |
Simon Hunt | d6685d0 | 2015-08-21 09:56:06 -0700 | [diff] [blame^] | 37 | this.type = checkNotNull(type); |
| 38 | this.elementId = checkNotNull(elementId); |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 39 | } |
| 40 | |
Simon Hunt | 4fc8685 | 2015-08-20 17:57:52 -0700 | [diff] [blame] | 41 | /** |
| 42 | * Returns the element type. |
| 43 | * |
| 44 | * @return element type |
| 45 | */ |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 46 | public TopoElementType type() { |
| 47 | return type; |
| 48 | } |
| 49 | |
Simon Hunt | 4fc8685 | 2015-08-20 17:57:52 -0700 | [diff] [blame] | 50 | /** |
| 51 | * Returns the element identifier. |
| 52 | * |
| 53 | * @return element identifier |
| 54 | */ |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 55 | public String elementId() { |
| 56 | return elementId; |
| 57 | } |
| 58 | } |