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)
28 public class NodeTableStatistics implements Serializable {
29 private static final long serialVersionUID = 1L;
32 private NodeTable nodeTable;
36 private int activeCount;
38 private long lookupCount;
40 private long matchedCount;
42 private int maximumEntries;
46 public int hashCode() {
49 result = prime * result + activeCount;
50 result = prime * result + (int) (lookupCount ^ (lookupCount >>> 32));
51 result = prime * result + (int) (matchedCount ^ (matchedCount >>> 32));
52 result = prime * result + maximumEntries;
53 result = prime * result + ((name == null) ? 0 : name.hashCode());
54 result = prime * result + ((nodeTable == null) ? 0 : nodeTable.hashCode());
59 public boolean equals(Object obj) {
66 if (!(obj instanceof NodeTableStatistics)) {
69 NodeTableStatistics other = (NodeTableStatistics) obj;
70 if (activeCount != other.activeCount) {
73 if (lookupCount != other.lookupCount) {
76 if (matchedCount != other.matchedCount) {
79 if (maximumEntries != other.maximumEntries) {
83 if (other.name != null) {
86 } else if (!name.equals(other.name)) {
89 if (nodeTable == null) {
90 if (other.nodeTable != null) {
93 } else if (!nodeTable.equals(other.nodeTable)) {
100 public NodeTableStatistics() {
105 * @return the node table
107 public NodeTable getNodeTable() {
112 * @param table of the node
114 public void setNodeTable(NodeTable table) {
115 this.nodeTable = table;
119 * @return name of the table
121 public String getName() {
126 * @param name - set the table name to name
128 public void setName(String name) {
133 * @return the activeCount
135 public int getActiveCount() {
140 * @param activeCount the activeCount to set
142 public void setActiveCount(int activeCount) {
143 this.activeCount = activeCount;
147 * @return the lookupCount
149 public long getLookupCount() {
154 * @param lookupCount the lookupCount to set
156 public void setLookupCount(long lookupCount) {
157 this.lookupCount = lookupCount;
161 * @return the matchedCount
163 public long getMatchedCount() {
168 * @param matchedCount the matchedCount to set
170 public void setMatchedCount(long matchedCount) {
171 this.matchedCount = matchedCount;
175 * @return the maximumEntries
177 public int getMaximumEntries() {
178 return maximumEntries;
182 * @param maximumEntries the maximumEntries to set
184 public void setMaximumEntries(int maximumEntries) {
185 this.maximumEntries = maximumEntries;
189 public String toString() {
190 return "NodeTableStats[tableId = " + nodeTable
191 + ", activeCount = " + activeCount
192 + ", lookupCount = " + lookupCount
193 + ", matchedCount = " + matchedCount
194 + ", maximumEntries = " + maximumEntries + "]";