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%2FNodeTableStatistics.java;h=7c404178cfc195edd206500c90ba4155c7e02f73;hp=3b359cb812408d0112b07b5e653b6c3e567a9a5b;hb=refs%2Fchanges%2F52%2F752%2F3;hpb=d4b6addab23cf24f20cd7969a7f1d800fda2bac1 diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeTableStatistics.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeTableStatistics.java index 3b359cb812..7c404178cf 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeTableStatistics.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeTableStatistics.java @@ -39,6 +39,56 @@ public class NodeTableStatistics implements Serializable { private long matchedCount; + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + activeCount; + result = prime * result + (int) (lookupCount ^ (lookupCount >>> 32)); + result = prime * result + (int) (matchedCount ^ (matchedCount >>> 32)); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((nodeTable == null) ? 0 : nodeTable.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof NodeTableStatistics)) { + return false; + } + NodeTableStatistics other = (NodeTableStatistics) obj; + if (activeCount != other.activeCount) { + return false; + } + if (lookupCount != other.lookupCount) { + return false; + } + if (matchedCount != other.matchedCount) { + return false; + } + if (name == null) { + if (other.name != null) { + return false; + } + } else if (!name.equals(other.name)) { + return false; + } + if (nodeTable == null) { + if (other.nodeTable != null) { + return false; + } + } else if (!nodeTable.equals(other.nodeTable)) { + return false; + } + return true; + } + //To Satisfy JAXB public NodeTableStatistics() {