* @return a wavelet snapshot that contains all the information in the
* original wavelet.
*/
public static WaveletSnapshot serializeWavelet(ReadableWaveletData wavelet,
HashedVersion hashedVersion) {
WaveletSnapshot builder = WaveletSnapshotJsoImpl.create();
builder.setWaveletId(ModernIdSerialiser.INSTANCE.serialiseWaveletId(wavelet.getWaveletId()));
for (ParticipantId participant : wavelet.getParticipants()) {
builder.addParticipantId(participant.toString());
}
for (String id : wavelet.getDocumentIds()) {
ReadableBlipData data = wavelet.getDocument(id);
builder.addDocument(serializeDocument(data));
}
builder.setVersion(WaveletOperationSerializer.serialize(hashedVersion));
builder.setLastModifiedTime(wavelet.getLastModifiedTime());
builder.setCreator(wavelet.getCreator().getAddress());
builder.setCreationTime(wavelet.getCreationTime());
return builder;
}