2 * Copyright (c) 2013 Big Switch Networks, Inc. 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
8 package org.opendaylight.controller.sal.reader;
10 import java.io.Serializable;
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
17 import org.opendaylight.controller.sal.core.NodeTable;
20 * @author Aditya Prakash Vaja <aditya.vaja@bigswitch.com>
21 * Represents the Table statistics for the node
26 @XmlAccessorType(XmlAccessType.NONE)
27 public class NodeTableStatistics implements Serializable {
28 private static final long serialVersionUID = 1L;
31 private NodeTable nodeTable;
35 private int activeCount;
37 private long lookupCount;
39 private long matchedCount;
43 public int hashCode() {
46 result = prime * result + activeCount;
47 result = prime * result + (int) (lookupCount ^ (lookupCount >>> 32));
48 result = prime * result + (int) (matchedCount ^ (matchedCount >>> 32));
49 result = prime * result + ((name == null) ? 0 : name.hashCode());
50 result = prime * result + ((nodeTable == null) ? 0 : nodeTable.hashCode());
55 public boolean equals(Object obj) {
62 if (!(obj instanceof NodeTableStatistics)) {
65 NodeTableStatistics other = (NodeTableStatistics) obj;
66 if (activeCount != other.activeCount) {
69 if (lookupCount != other.lookupCount) {
72 if (matchedCount != other.matchedCount) {
76 if (other.name != null) {
79 } else if (!name.equals(other.name)) {
82 if (nodeTable == null) {
83 if (other.nodeTable != null) {
86 } else if (!nodeTable.equals(other.nodeTable)) {
93 public NodeTableStatistics() {
98 * @return the node table
100 public NodeTable getNodeTable() {
105 * @param table of the node
107 public void setNodeTable(NodeTable table) {
108 this.nodeTable = table;
112 * @return name of the table
114 public String getName() {
119 * @param name - set the table name to name
121 public void setName(String name) {
126 * @return the activeCount
128 public int getActiveCount() {
133 * @param activeCount the activeCount to set
135 public void setActiveCount(int activeCount) {
136 this.activeCount = activeCount;
140 * @return the lookupCount
142 public long getLookupCount() {
147 * @param lookupCount the lookupCount to set
149 public void setLookupCount(long lookupCount) {
150 this.lookupCount = lookupCount;
154 * @return the matchedCount
156 public long getMatchedCount() {
161 * @param matchedCount the matchedCount to set
163 public void setMatchedCount(long matchedCount) {
164 this.matchedCount = matchedCount;
168 public String toString() {
169 return "NodeTableStats[tableId = " + nodeTable
170 + ", activeCount = " + activeCount
171 + ", lookupCount = " + lookupCount
172 + ", matchedCount = " + matchedCount + "]";