*
* @param document The document to serialize
* @return A snapshot of the given document
*/
public static DocumentSnapshot serializeDocument(ReadableBlipData document) {
DocumentSnapshot builder = DocumentSnapshotJsoImpl.create();
builder.setDocumentId(document.getId());
builder.setDocumentOperation(WaveletOperationSerializer.serialize(
document.getContent().asOperation()));
builder.setAuthor(document.getAuthor().getAddress());
for (ParticipantId participant : document.getContributors()) {
builder.addContributor(participant.getAddress());
}
builder.setLastModifiedVersion(document.getLastModifiedVersion());
builder.setLastModifiedTime(document.getLastModifiedTime());
return builder;
}