Class: PatchDeserializer

olympe.dc.transaction. PatchDeserializer

Patch serializer & deserializer


new PatchDeserializer( [sourceId])

Parameters:
Name Type Argument Default Description
sourceId olympe.dc.SourceType | string <optional>
olympe.dc.SourceType.SERVER

Methods


deserialize(operations)

Deserializes an array of patch operations into an GraphPatch.

This method is called when the array of operation is a subcomponent of a larger JSON structure, that is being parsed beforehand. In that case, the parsing is already done which makes calling deserializeJson() above irrelevant.

Parameters:
Name Type Description
operations Array.<Object>

Patch operations as received by the server

Throws:
Error
Returns:

The created patch

Type
olympe.dc.db.GraphPatch

deserializeJson(json)

Return a graph patch containing all the data contained in the specified json string.

Parameters:
Name Type Description
json string
Returns:
Type
olympe.dc.db.GraphPatch

setSourceId(sourceId)

Sets the source identifier for all deserialized instances

Parameters:
Name Type Description
sourceId string