ParticipantId author = deserializeParicipantId((DBObject) dbObject.get(FIELD_AUTHOR));
HashedVersion resultingVersion =
deserializeHashedVersion((DBObject) dbObject.get(FIELD_RESULTINGVERSION));
long applicationTimestamp = (Long) dbObject.get(FIELD_APPLICATIONTIMESTAMP);
BasicDBList dbOps = (BasicDBList) dbObject.get(FIELD_OPS);
ImmutableList.Builder<WaveletOperation> operations = ImmutableList.builder();
int numOperations = dbOps.size();
// Code analog to ProtoDeltaStoreDataSerializer.deserialize
for (int i = 0; i < numOperations; i++) {
WaveletOperationContext context;
if (i == numOperations - 1) {
context = new WaveletOperationContext(author, applicationTimestamp, 1, resultingVersion);
} else {
context = new WaveletOperationContext(author, applicationTimestamp, 1);
}
operations.add(deserializeWaveletOperation((DBObject) dbOps.get(i), context));
}
return new TransformedWaveletDelta(author, resultingVersion, applicationTimestamp,
operations.build());
}