X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Freader%2FFlowOnNode.java;h=994ee4533e077ab3ad74e65f08306d10a9910320;hp=163d04b3ffc253ed028d25b8a8d70686c82b325e;hb=refs%2Fchanges%2F52%2F752%2F3;hpb=d4b6addab23cf24f20cd7969a7f1d800fda2bac1 diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/FlowOnNode.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/FlowOnNode.java index 163d04b3ff..994ee4533e 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/FlowOnNode.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/FlowOnNode.java @@ -114,6 +114,56 @@ public class FlowOnNode implements Serializable{ this.durationNanoseconds = durationNanoseconds; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (int) (byteCount ^ (byteCount >>> 32)); + result = prime * result + durationNanoseconds; + result = prime * result + durationSeconds; + result = prime * result + ((flow == null) ? 0 : flow.hashCode()); + result = prime * result + (int) (packetCount ^ (packetCount >>> 32)); + result = prime * result + tableId; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof FlowOnNode)) { + return false; + } + FlowOnNode other = (FlowOnNode) obj; + if (byteCount != other.byteCount) { + return false; + } + if (durationNanoseconds != other.durationNanoseconds) { + return false; + } + if (durationSeconds != other.durationSeconds) { + return false; + } + if (flow == null) { + if (other.flow != null) { + return false; + } + } else if (!flow.equals(other.flow)) { + return false; + } + if (packetCount != other.packetCount) { + return false; + } + if (tableId != other.tableId) { + return false; + } + return true; + } + @Override public String toString() { return "FlowOnNode[flow =" + flow + ", tableId = " + tableId