Merge "Bug fix for ForwardingRulesManager: addFlow and addFlowAsync are reversed."
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / topology / TopoEdgeUpdate.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.sal.topology;
10
11 import java.util.Set;
12
13 import org.apache.commons.lang3.builder.EqualsBuilder;
14 import org.apache.commons.lang3.builder.HashCodeBuilder;
15 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
16 import org.opendaylight.controller.sal.core.Edge;
17 import org.opendaylight.controller.sal.core.Property;
18 import org.opendaylight.controller.sal.core.UpdateType;
19
20 /**
21  * The class represents an Edge, the Edge's Property Set and its UpdateType.
22  */
23
24 public class TopoEdgeUpdate {
25     private Edge edge;
26     private Set<Property> props;
27     private UpdateType type;
28
29     public TopoEdgeUpdate(Edge e, Set<Property> p, UpdateType t) {
30         edge = e;
31         props = p;
32         type = t;
33     }
34
35     public Edge getEdge() {
36         return edge;
37     }
38
39     public Set<Property> getProperty() {
40         return props;
41     }
42
43     public UpdateType getUpdateType() {
44         return type;
45     }
46
47     @Override
48     public int hashCode() {
49         return HashCodeBuilder.reflectionHashCode(this);
50     }
51
52     @Override
53     public String toString() {
54         return "TopoEdgeUpdate[" + ReflectionToStringBuilder.toString(this)
55                 + "]";
56     }
57
58     @Override
59     public boolean equals(Object obj) {
60         return EqualsBuilder.reflectionEquals(this, obj);
61     }
62 }