Introduce top-level pom file.
[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 //
13         Identifier<Node> {
14         private static final long serialVersionUID = 1L;
15         private final int id;
16
17     public NodeKey(int id) {
18         super();
19         this.id = id;
20     }
21
22     public int getId() {
23         return id;
24     }
25
26     @Override
27     public int hashCode() {
28         final int prime = 31;
29         int result = 1;
30         result = prime * result + id;
31         return result;
32     }
33
34     @Override
35     public boolean equals(Object obj) {
36         if (this == obj)
37             return true;
38         if (obj == null)
39             return false;
40         if (getClass() != obj.getClass())
41             return false;
42         NodeKey other = (NodeKey) obj;
43         if (id != other.id)
44             return false;
45         return true;
46     }
47 }