Rename yang.binding.{Identifiable,Identifier}
[mdsal.git] / binding / 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;
9
10 import java.io.Serial;
11 import org.opendaylight.yangtools.yang.binding.Key;
12
13 public class NodeChildKey implements Key<NodeChild> {
14     @Serial
15     private static final long serialVersionUID = 1L;
16
17     private final int id;
18
19     public NodeChildKey(final int id) {
20         this.id = id;
21     }
22
23     public int getId() {
24         return id;
25     }
26
27     @Override
28     public int hashCode() {
29         return Integer.hashCode(id);
30     }
31
32     @Override
33     public boolean equals(final Object obj) {
34         return this == obj || obj != null && getClass() == obj.getClass() && id == ((NodeChildKey) obj).id;
35     }
36 }