2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.sal.topology;
13 import org.opendaylight.controller.sal.core.Edge;
14 import org.opendaylight.controller.sal.core.Property;
15 import org.opendaylight.controller.sal.core.UpdateType;
18 * The class represents an Edge, the Edge's Property Set and its UpdateType.
19 * If update is on new properties added to an existing edge, appropriate type is CHANGED.
21 public class TopoEdgeUpdate {
23 private Set<Property> props;
24 private UpdateType type;
25 private boolean isLocal;
28 * Constructor for a topology element update. A TopologyElementUpdate is an
29 * object that summarize what has happened on an Edge and if the update is
30 * generated locally to this controller or no
35 * Set of Properties attached to the edge
39 public TopoEdgeUpdate(Edge e, Set<Property> p, UpdateType t) {
46 public Edge getEdge() {
50 public Set<Property> getProperty() {
54 public UpdateType getUpdateType() {
59 public int hashCode() {
62 result = (prime * result) + ((edge == null) ? 0 : edge.hashCode());
63 result = (prime * result) + ((type == null) ? 0 : type.hashCode());
68 public String toString() {
69 return "TopoEdgeUpdate [edge=" + edge + ", props=" + props + ", type=" + type + ", isLocal=" + isLocal + "]";
73 public boolean equals(Object obj) {
80 if (getClass() != obj.getClass()) {
83 TopoEdgeUpdate other = (TopoEdgeUpdate) obj;
85 if (other.edge != null) {
88 } else if (!edge.equals(other.edge)) {
91 if (type != other.type) {
97 public boolean isLocal() {
101 public void setLocal(boolean isLocal) {
102 this.isLocal = isLocal;