blob: 9f789b20ac00a6cb30ec27c2dcd8ceb344b024ec [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 Huntd6685d02015-08-21 09:56:06 -070020import static com.google.common.base.Preconditions.checkNotNull;
21
Simon Hunta17fa672015-08-19 18:42:22 -070022/**
Simon Hunt4fc86852015-08-20 17:57:52 -070023 * Partial implementation of the highlighting to apply to topology
24 * view elements.
Simon Hunta17fa672015-08-19 18:42:22 -070025 */
26public abstract class AbstractHighlight {
27 private final TopoElementType type;
28 private final String elementId;
29
Simon Hunt4fc86852015-08-20 17:57:52 -070030 /**
31 * Constructs the highlight.
32 *
33 * @param type highlight element type
34 * @param elementId element identifier
35 */
Simon Hunta17fa672015-08-19 18:42:22 -070036 public AbstractHighlight(TopoElementType type, String elementId) {
Simon Huntd6685d02015-08-21 09:56:06 -070037 this.type = checkNotNull(type);
38 this.elementId = checkNotNull(elementId);
Simon Hunta17fa672015-08-19 18:42:22 -070039 }
40
Simon Hunt4fc86852015-08-20 17:57:52 -070041 /**
42 * Returns the element type.
43 *
44 * @return element type
45 */
Simon Hunta17fa672015-08-19 18:42:22 -070046 public TopoElementType type() {
47 return type;
48 }
49
Simon Hunt4fc86852015-08-20 17:57:52 -070050 /**
51 * Returns the element identifier.
52 *
53 * @return element identifier
54 */
Simon Hunta17fa672015-08-19 18:42:22 -070055 public String elementId() {
56 return elementId;
57 }
58}