Class Mod
java.lang.Object
io.debezium.connector.spanner.db.model.Mod
Represents a modification in a table emitted within a
DataChangeEvent. Each mod contains
keys, new values and old values returned as JSON strings.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.fasterxml.jackson.databind.JsonNodeprivate final intprivate final com.fasterxml.jackson.databind.JsonNodeprivate final com.fasterxml.jackson.databind.JsonNode -
Constructor Summary
ConstructorsConstructorDescriptionMod(int modNumber, com.fasterxml.jackson.databind.JsonNode keysJsonNode, com.fasterxml.jackson.databind.JsonNode oldValuesJsonNode, com.fasterxml.jackson.databind.JsonNode newValuesJsonNode) Constructs a mod from the primary key values, the old state of the row and the new state of the row. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodegetKeyJsonNode(String name) intcom.fasterxml.jackson.databind.JsonNodegetNewValueNode(String name) com.fasterxml.jackson.databind.JsonNodegetOldValueNode(String name) com.fasterxml.jackson.databind.JsonNodeThe primary keys of this specific modification.com.fasterxml.jackson.databind.JsonNodeThe new column values after the modification was applied.com.fasterxml.jackson.databind.JsonNodeThe old column values before the modification was applied.toString()
-
Field Details
-
keysJsonNode
private final com.fasterxml.jackson.databind.JsonNode keysJsonNode -
oldValuesJsonNode
private final com.fasterxml.jackson.databind.JsonNode oldValuesJsonNode -
newValuesJsonNode
private final com.fasterxml.jackson.databind.JsonNode newValuesJsonNode -
modNumber
private final int modNumber
-
-
Constructor Details
-
Mod
public Mod(int modNumber, com.fasterxml.jackson.databind.JsonNode keysJsonNode, com.fasterxml.jackson.databind.JsonNode oldValuesJsonNode, com.fasterxml.jackson.databind.JsonNode newValuesJsonNode) Constructs a mod from the primary key values, the old state of the row and the new state of the row.- Parameters:
modNumber- Modification index numberkeysJsonNode- JSON object as String, where the keys are the primary key column names and the values are the primary key column valuesoldValuesJsonNode- JSON object as String, displaying the old state of the columns modified. This JSON object can be null in the case of an INSERTnewValuesJsonNode- 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
-
oldValuesJsonNode
public com.fasterxml.jackson.databind.JsonNode oldValuesJsonNode()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
-
newValuesJsonNode
public com.fasterxml.jackson.databind.JsonNode newValuesJsonNode()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
-
keysJsonNode
public com.fasterxml.jackson.databind.JsonNode keysJsonNode()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
-
getKeyJsonNode
-
getNewValueNode
-
getOldValueNode
-
getModNumber
public int getModNumber() -
toString
-