Fixup javadoc
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / ShardDataTreeSnapshotMetadata.java
index a20ec4eba4e04461e30a30f1b470076dd2591a7b..25cfda0177f1f76281e15d258e61d90410f58943 100644 (file)
@@ -15,18 +15,20 @@ import javax.annotation.Nonnull;
 /**
  * Base class for various bits of metadata attached to a {@link MetadataShardDataTreeSnapshot}. This class is not
  * an interface because we want to make sure all subclasses implement the externalizable proxy pattern, for which
- * we need to force {@link #readResolve()} to be abstract.
- *
+ * we need to force {@link #writeReplace()} to be abstract. We do that by making it final and exposing a protected
+ * {@link #externalizableProxy()} method.
+ * <p/>
  * All concrete subclasses of this class should be final so as to form a distinct set of possible metadata. Since
  * metadata is serialized along with {@link MetadataShardDataTreeSnapshot}, this set is part of the serialization format
  * guarded by {@link PayloadVersion}.
- *
+ * <p/>
  * If a new metadata type is introduced or a type is removed, {@link PayloadVersion} needs to be bumped to ensure
  * compatibility.
  *
  * @author Robert Varga
  */
-public abstract class ShardDataTreeSnapshotMetadata implements Serializable {
+public abstract class ShardDataTreeSnapshotMetadata<T extends ShardDataTreeSnapshotMetadata<T>>
+        implements Serializable {
     private static final long serialVersionUID = 1L;
 
     ShardDataTreeSnapshotMetadata() {
@@ -38,9 +40,11 @@ public abstract class ShardDataTreeSnapshotMetadata implements Serializable {
     }
 
     /**
-     * Return an Externalizable proxy
+     * Return an Externalizable proxy.
      *
      * @return Externalizable proxy, may not be null
      */
     protected abstract @Nonnull Externalizable externalizableProxy();
+
+    public abstract Class<T> getType();
 }