Class Mod
java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.model.Mod
- All Implemented Interfaces:
Serializable
Represents a modification in a table emitted within a
DataChangeRecord
. Each mod contains
keys, new values and old values returned as JSON strings.- See Also:
-
Constructor Details
-
Mod
Constructs a mod from the primary key values, the old state of the row and the new state of the row.- Parameters:
keysJson
- JSON object as String, where the keys are the primary key column names and the values are the primary key column valuesoldValuesJson
- JSON object as String, displaying the old state of the columns modified. This JSON object can be null in the case of an INSERTnewValuesJson
- JSON object as String, displaying the new state of the columns modified. This JSON object can be null in the case of a DELETE
-
-
Method Details
-
getOldValuesJson
The old column values before the modification was applied. This can be null when the modification was emitted for an INSERT operation. The values are returned as a JSON object (stringified), where the keys are the column names and the values are the column values.- Returns:
- JSON object as String representing the old column values before the row was modified
-
getNewValuesJson
The new column values after the modification was applied. This can be null when the modification was emitted for a DELETE operation. The values are returned as a JSON object (stringified), where the keys are the column names and the values are the column values.- Returns:
- JSON object as String representing the new column values after the row was modified
-
getKeysJson
The primary keys of this specific modification. This is always present and can not be null. The keys are returned as a JSON object (stringified), where the keys are the column names and the values are the column values.- Returns:
- JSON object as String representing the primary key state for the row modified
-
equals
-
hashCode
public int hashCode() -
toString
-