X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Fconcepts%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fconcepts%2FIdentifier.java;h=694710505fb6ff4a8e2eb9e69384a53d1b418053;hb=2aabca17445804c8d86ca830e7bbf5fa9308bba1;hp=148865b850cec84120517d8a6451e66072b6d441;hpb=45259276c965022d43fa4cc8854da5b8120add8e;p=yangtools.git diff --git a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Identifier.java b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Identifier.java index 148865b850..694710505f 100644 --- a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Identifier.java +++ b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Identifier.java @@ -10,12 +10,26 @@ package org.opendaylight.yangtools.concepts; import java.io.Serializable; /** - * General identifier interface. It is primarily a marker for all things that - * identify concepts -- such as names, addresses, classes, etc. We do not - * require too much, just that the identifiers are serializable (and this + * General identifier interface. It is primarily a marker for all things that identify concepts -- such as names, + * addresses, classes, etc. We do not require too much, just that the identifiers are serializable (and thus * transferable). + * + *

Implementations are expected to implement {@link #hashCode()} and {@link #equals(Object)} methods in a way, + * which ensures that objects before and after serialization are considered equal. + * + *

Implementations are advised to use the {@link java.io.Externalizable} Proxy pattern to allow future evolution + * of their serialization format. For further efficiency, implementations should consider implementing + * {@link WritableObject}, so they can be efficiently embedded in other {@link Serializable} and {@code WritableObject}s + * objects. */ public interface Identifier extends Serializable, Immutable { + @Override + boolean equals(Object obj); + + @Override + int hashCode(); + @Override + String toString(); }