Class VersionedSerializer.FormatVersion<TargetType,ReaderType>
- java.lang.Object
-
- io.pravega.common.io.serialization.VersionedSerializer.FormatVersion<TargetType,ReaderType>
-
- Type Parameters:
TargetType- Type of the object to serialize.ReaderType- Type of the object to deserialize to.
- Enclosing class:
- VersionedSerializer<T>
protected static class VersionedSerializer.FormatVersion<TargetType,ReaderType> extends java.lang.ObjectRepresents a Version of a Format. A Version has multiple Revisions that are built incrementally on top of each other, starting with base revision 0 and going up to a maximum revision 127.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<io.pravega.common.io.serialization.VersionedSerializer.FormatRevision<TargetType,ReaderType>>getRevisions()bytegetVersion()VersionedSerializer.FormatVersion<TargetType,ReaderType>revision(int revision, VersionedSerializer.StreamWriter<TargetType> writer, VersionedSerializer.StreamReader<ReaderType> reader)Creates a new Revision and registers it.
-
-
-
Method Detail
-
revision
public VersionedSerializer.FormatVersion<TargetType,ReaderType> revision(int revision, VersionedSerializer.StreamWriter<TargetType> writer, VersionedSerializer.StreamReader<ReaderType> reader)
Creates a new Revision and registers it.- Parameters:
revision- The Revision Id. If the first revision in the Version, this must be 0. If not, it must be the next number higher than the previous Revision Id (revisions ids are incremental numbers).writer- A Function that will serialize the contents of the target object into this Revision's Format.reader- A Function that will deserialize data pertaining to this Revision's Format into the target object.- Returns:
- This object.
-
getVersion
public byte getVersion()
-
getRevisions
public java.util.ArrayList<io.pravega.common.io.serialization.VersionedSerializer.FormatRevision<TargetType,ReaderType>> getRevisions()
-
-