Merge "Get rid of NetconfMessageFactory"
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / sal / binding / test / mock / ReferencableObjectKey.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.sal.binding.test.mock;
9
10 import org.opendaylight.yangtools.yang.binding.Identifier;
11
12 public class ReferencableObjectKey implements Identifier<ReferencableObject> {
13
14     final Integer value;
15     
16     public ReferencableObjectKey(Integer _value) {
17         this.value = _value;
18     }
19
20     @Override
21     public int hashCode() {
22         final int prime = 31;
23         int result = 1;
24         result = prime * result + ((value == null) ? 0 : value.hashCode());
25         return result;
26     }
27
28     @Override
29     public boolean equals(Object obj) {
30         if (this == obj)
31             return true;
32         if (obj == null)
33             return false;
34         if (getClass() != obj.getClass())
35             return false;
36         ReferencableObjectKey other = (ReferencableObjectKey) obj;
37         if (value == null) {
38             if (other.value != null)
39                 return false;
40         } else if (!value.equals(other.value))
41             return false;
42         return true;
43     }
44
45     @Override
46     public String toString() {
47         return "ReferencableObjectKey [value=" + value + "]";
48     }
49     
50     
51 }