BUG 1839 - HTTP delete of non existing data
[controller.git] / opendaylight / md-sal / statistics-manager / src / main / java / org / opendaylight / controller / md / statistics / manager / QueueStatsEntry.java
1 /*
2  * Copyright IBM Corporation, 2013.  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 package org.opendaylight.controller.md.statistics.manager;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
12
13 final class QueueStatsEntry {
14     private final NodeConnectorId nodeConnectorId;
15     private final QueueId queueId;
16     public QueueStatsEntry(NodeConnectorId ncId, QueueId queueId){
17         this.nodeConnectorId = ncId;
18         this.queueId = queueId;
19     }
20     public NodeConnectorId getNodeConnectorId() {
21         return nodeConnectorId;
22     }
23     public QueueId getQueueId() {
24         return queueId;
25     }
26     @Override
27     public int hashCode() {
28         final int prime = 31;
29         int result = 1;
30         result = prime * result + ((nodeConnectorId == null) ? 0 : nodeConnectorId.hashCode());
31         result = prime * result + ((queueId == null) ? 0 : queueId.hashCode());
32         return result;
33     }
34     @Override
35     public boolean equals(Object obj) {
36         if (this == obj) {
37             return true;
38         }
39         if (obj == null) {
40             return false;
41         }
42         if (!(obj instanceof QueueStatsEntry)) {
43             return false;
44         }
45         QueueStatsEntry other = (QueueStatsEntry) obj;
46         if (nodeConnectorId == null) {
47             if (other.nodeConnectorId != null) {
48                 return false;
49             }
50         } else if (!nodeConnectorId.equals(other.nodeConnectorId)) {
51             return false;
52         }
53         if (queueId == null) {
54             if (other.queueId != null) {
55                 return false;
56             }
57         } else if (!queueId.equals(other.queueId)) {
58             return false;
59         }
60         return true;
61     }
62 }