BUG-5626: introduce utility identifiers
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / Identifier.java
1 /*
2  * Copyright (c) 2013 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.concepts;
9
10 import java.io.Serializable;
11
12 /**
13  * General identifier interface. It is primarily a marker for all things that
14  * identify concepts -- such as names, addresses, classes, etc. We do not
15  * require too much, just that the identifiers are serializable (and this
16  * transferable).
17  *
18  * Implementations are expected to implement hashCode() and equals() methods
19  * in a way, which ensures that objects before and after serialization are
20  * considered equal.
21  *
22  * Implementations are advised to use the Externalizable Proxy pattern to
23  * allow future evolution of their serialization format.
24  */
25 public interface Identifier extends Serializable, Immutable {
26     @Override
27     boolean equals(Object o);
28
29     @Override
30     int hashCode();
31
32     @Override
33     String toString();
34 }
35