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