Creates a new PatchBuilder instance.
Clock to use for generating timestamps.
Create a new immutable constant JSON value. Can be anything, including nested arrays and objects.
JSON value
ID of the new operation.
Given a JSON value
creates the necessary builder commands to create
JSON CRDT Patch operations to construct the value. If the value
is a
timestamp, it is returned as-is. If the value
is a JSON primitive is
a number, boolean, or null
, it is converted to a "con" data type. Otherwise,
the value
is converted using the PatchBuilder.json method.
A JSON value for which to create JSON CRDT Patch construction operations.
ID of the root constructed CRDT object.
Delete a span of operations.
Object in which to delete something.
List of time spans to delete.
ID of the new operation.
Insert elements into an "arr" object.
ID of the new operation.
Insert binary data into a "bin" object.
ID of the new operation.
Set fields of an "obj" object.
ID of the new operation.
Insert a substring into a "str" object.
ID of the new operation.
Set elements of a "vec" object.
ID of the new operation.
Run the necessary builder commands to create any arbitrary JSON value.
Run the necessary builder commands to create an arbitrary JSON array.
Run builder commands to create a binary data type.
Run the necessary builder commands to create an arbitrary JSON object.
Creates a "con" data type unless the value is already a timestamp, in which case it is returned as-is.
Value to convert to a "con" data type.
ID of the new "con" object.
Retrieve the sequence number of the next timestamp.
The next timestamp sequence number that will be used by the builder.
Operation that does nothing just skips IDs in the patch.
Length of the operation.
ID of the new operation.
Add padding "noop" operation if clock's time has jumped. This method checks if clock has advanced past the ID of the last operation of the patch and, if so, adds a "noop" operation to the patch to pad the gap.
Set value of document's root LWW-Register.
ID of the new operation.
Set value of a "val" object.
ID of the new operation.
Update an element in an "arr" object.
ID of the new operation.
Create a new "val" LWW-Register object. Can be anything, including nested arrays and objects.
ID of the new operation.
Utility class that helps in Patch construction.