Fix checkstyle violations in yang-binding
[mdsal.git] / binding / yang-binding / src / test / java / org / opendaylight / yangtools / yang / binding / test / mock / NodeKey.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.yangtools.yang.binding.test.mock;
9
10 import org.opendaylight.yangtools.yang.binding.Identifier;
11
12 public class NodeKey implements Identifier<Node> {
13     private static final long serialVersionUID = 1L;
14
15     private final int id;
16
17     public NodeKey(final int id) {
18         this.id = id;
19     }
20
21     public int getId() {
22         return id;
23     }
24
25     @Override
26     public int hashCode() {
27         return Integer.hashCode(id);
28     }
29
30     @Override
31     public boolean equals(final Object obj) {
32         if (this == obj) {
33             return true;
34         }
35         if (obj == null) {
36             return false;
37         }
38         if (getClass() != obj.getClass()) {
39             return false;
40         }
41         NodeKey other = (NodeKey) obj;
42         if (id != other.id) {
43             return false;
44         }
45         return true;
46     }
47 }