blob: 661f0818e48a74fafe4e5deb5f597ea5677b221a [file] [log] [blame]
Jonathan Harte37e4e22014-05-13 19:12:02 -07001package net.onrc.onos.core.topology;
2
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -07003import org.apache.commons.lang.Validate;
4
Jonathan Harte37e4e22014-05-13 19:12:02 -07005
Praseed Balakrishnan57ed8432014-06-26 11:49:56 -07006
Yuta HIGUCHIc45e0b62014-06-24 22:34:20 -07007/**
8 * Base class for Topology Objects.
9 */
Praseed Balakrishnan57ed8432014-06-26 11:49:56 -070010public abstract class TopologyObject {
Jonathan Harte37e4e22014-05-13 19:12:02 -070011
Yuta HIGUCHIc45e0b62014-06-24 22:34:20 -070012 /**
13 * Topology instance this object belongs to.
14 */
Jonathan Harte37e4e22014-05-13 19:12:02 -070015 protected final Topology topology;
16
Yuta HIGUCHIc45e0b62014-06-24 22:34:20 -070017 /**
18 * Constructor.
19 *
20 * @param topology Topology instance this object belongs to
21 */
22 protected TopologyObject(Topology topology) {
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -070023 Validate.notNull(topology);
Jonathan Harte37e4e22014-05-13 19:12:02 -070024 this.topology = topology;
25 }
26
Praseed Balakrishnan57ed8432014-06-26 11:49:56 -070027
28 /**
29 * Returns the type of topology object.
30 *
31 * @return the type of the topology object
32 */
33 public abstract String getType();
34
35
Jonathan Harte37e4e22014-05-13 19:12:02 -070036}