Fix occasional NPEs in Connection manager
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / sal / binding / test / mock / ReferencableObjectKey.java
1 package org.opendaylight.controller.sal.binding.test.mock;
2
3 import org.opendaylight.yangtools.yang.binding.Identifier;
4
5 public class ReferencableObjectKey implements Identifier<ReferencableObject> {
6
7     final Integer value;
8     
9     public ReferencableObjectKey(Integer _value) {
10         this.value = _value;
11     }
12
13     @Override
14     public int hashCode() {
15         final int prime = 31;
16         int result = 1;
17         result = prime * result + ((value == null) ? 0 : value.hashCode());
18         return result;
19     }
20
21     @Override
22     public boolean equals(Object obj) {
23         if (this == obj)
24             return true;
25         if (obj == null)
26             return false;
27         if (getClass() != obj.getClass())
28             return false;
29         ReferencableObjectKey other = (ReferencableObjectKey) obj;
30         if (value == null) {
31             if (other.value != null)
32                 return false;
33         } else if (!value.equals(other.value))
34             return false;
35         return true;
36     }
37
38     @Override
39     public String toString() {
40         return "ReferencableObjectKey [value=" + value + "]";
41     }
42     
43     
44 }