Fix checkstyle violations in sal-binding-broker
[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     private static final long serialVersionUID = 1L;
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         }
33         if (obj == null) {
34             return false;
35         }
36         if (getClass() != obj.getClass()) {
37             return false;
38         }
39         ReferencableObjectKey other = (ReferencableObjectKey) obj;
40         if (value == null) {
41             if (other.value != null) {
42                 return false;
43             }
44         } else if (!value.equals(other.value)) {
45             return false;
46         }
47         return true;
48     }
49
50     @Override
51     public String toString() {
52         return "ReferencableObjectKey [value=" + value + "]";
53     }
54
55
56 }