blob: f9299267fabde3ed1cfdd3081149ea4ef18b965a [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 */
Yuta HIGUCHI692e68e2014-07-09 18:08:02 -070010public abstract class TopologyObject implements ITopologyElement {
Jonathan Harte37e4e22014-05-13 19:12:02 -070011
Yuta HIGUCHI1222ac52014-07-09 16:50:28 -070012 // XXX This will be a snapshot, thus should be replaceable
Yuta HIGUCHIc45e0b62014-06-24 22:34:20 -070013 /**
14 * Topology instance this object belongs to.
15 */
Jonathan Harte37e4e22014-05-13 19:12:02 -070016 protected final Topology topology;
17
Yuta HIGUCHIc45e0b62014-06-24 22:34:20 -070018 /**
19 * Constructor.
20 *
21 * @param topology Topology instance this object belongs to
22 */
23 protected TopologyObject(Topology topology) {
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -070024 Validate.notNull(topology);
Jonathan Harte37e4e22014-05-13 19:12:02 -070025 this.topology = topology;
26 }
27
Praseed Balakrishnan57ed8432014-06-26 11:49:56 -070028
29 /**
30 * Returns the type of topology object.
31 *
32 * @return the type of the topology object
33 */
Yuta HIGUCHI692e68e2014-07-09 18:08:02 -070034 @Override
Praseed Balakrishnan57ed8432014-06-26 11:49:56 -070035 public abstract String getType();
36
37
Jonathan Harte37e4e22014-05-13 19:12:02 -070038}