ELAN FT Support for BE
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / GroupInfoKey.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  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.vpnservice.mdsalutil;
9
10 import java.math.BigInteger;
11
12 public final class GroupInfoKey {
13
14     private final BigInteger dpId;
15     private final long groupId;
16
17     public GroupInfoKey(BigInteger dpId, long groupId) {
18         this.dpId = dpId;
19         this.groupId = groupId;
20     }
21
22     public long getGroupId() {
23         return groupId;
24     }
25
26     public BigInteger getDpId() {
27         return dpId;
28     }
29
30     @Override
31     public int hashCode() {
32         final int prime = 31;
33         int result = 1;
34         result = prime * result + ((dpId == null) ? 0 : dpId.hashCode());
35         result = prime * result + (int) (groupId ^ (groupId >>> 32));
36         return result;
37     }
38
39     @Override
40     public boolean equals(Object obj) {
41         if (this == obj)
42             return true;
43         if (obj == null)
44             return false;
45         if (getClass() != obj.getClass())
46             return false;
47         GroupInfoKey other = (GroupInfoKey) obj;
48         if (dpId == null) {
49             if (other.dpId != null)
50                 return false;
51         } else if (!dpId.equals(other.dpId))
52             return false;
53         if (groupId != other.groupId)
54             return false;
55         return true;
56     }
57
58     @Override
59     public String toString() {
60         return "GroupStatisticsKey [dpId=" + dpId + ", groupId=" + groupId + "]";
61     }
62
63 }