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.
22 public class TopoEdgeUpdate {
24 private Set<Property> props;
25 private UpdateType type;
26 private boolean isLocal;
29 * Constructor for a topology element update. A TopologyElementUpdate is an
30 * object that summarize what has happened on an Edge and if the update is
31 * generated locally to this controller or no
36 * Set of Properties attached to the edge
40 public TopoEdgeUpdate(Edge e, Set<Property> p, UpdateType t) {
47 public Edge getEdge() {
51 public Set<Property> getProperty() {
55 public UpdateType getUpdateType() {
60 public int hashCode() {
63 result = (prime * result) + ((edge == null) ? 0 : edge.hashCode());
64 result = (prime * result) + ((type == null) ? 0 : type.hashCode());
69 public String toString() {
70 return "TopoEdgeUpdate [edge=" + edge + ", props=" + props + ", type=" + type + ", isLocal=" + isLocal + "]";
74 public boolean equals(Object obj) {
81 if (getClass() != obj.getClass()) {
84 TopoEdgeUpdate other = (TopoEdgeUpdate) obj;
86 if (other.edge != null) {
89 } else if (!edge.equals(other.edge)) {
92 if (type != other.type) {
98 public boolean isLocal() {
102 public void setLocal(boolean isLocal) {
103 this.isLocal = isLocal;