java.lang.Object
io.debezium.connector.spanner.db.model.Mod

public class Mod extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private final com.fasterxml.jackson.databind.JsonNode
     
    private final int
     
    private final com.fasterxml.jackson.databind.JsonNode
     
    private final com.fasterxml.jackson.databind.JsonNode
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    com.fasterxml.jackson.databind.JsonNode
     
    int
     
    com.fasterxml.jackson.databind.JsonNode
     
    com.fasterxml.jackson.databind.JsonNode
     
    int
     
    com.fasterxml.jackson.databind.JsonNode
    The primary keys of this specific modification.
    com.fasterxml.jackson.databind.JsonNode
    The new column values after the modification was applied.
    com.fasterxml.jackson.databind.JsonNode
    The old column values before the modification was applied.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 number
      keysJsonNode - JSON object as String, where the keys are the primary key column names and the values are the primary key column values
      oldValuesJsonNode - JSON object as String, displaying the old state of the columns modified. This JSON object can be null in the case of an INSERT
      newValuesJsonNode - 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

      public com.fasterxml.jackson.databind.JsonNode getKeyJsonNode(String name)
    • getNewValueNode

      public com.fasterxml.jackson.databind.JsonNode getNewValueNode(String name)
    • getOldValueNode

      public com.fasterxml.jackson.databind.JsonNode getOldValueNode(String name)
    • getModNumber

      public int getModNumber()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object