Interface DeltaEngine

All Known Implementing Classes:
DefaultDeltaEngine

public interface DeltaEngine
Computes replayable deltas between two JSON documents and applies them later.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.JsonNode
    apply(com.fasterxml.jackson.databind.JsonNode before, DeltaResult delta)
    Applies a computed delta to a source document.
    compute(com.fasterxml.jackson.databind.JsonNode before, com.fasterxml.jackson.databind.JsonNode after)
    Computes a deterministic delta between two Jackson trees.
    compute(String beforeJson, String afterJson)
    Parses two JSON strings and computes a deterministic delta between them.
  • Method Details

    • compute

      DeltaResult compute(com.fasterxml.jackson.databind.JsonNode before, com.fasterxml.jackson.databind.JsonNode after)
      Computes a deterministic delta between two Jackson trees.
      Parameters:
      before - original document
      after - target document
      Returns:
      computed delta result
      Throws:
      DeltaComputationException - if the comparison cannot be completed
    • compute

      DeltaResult compute(String beforeJson, String afterJson)
      Parses two JSON strings and computes a deterministic delta between them.
      Parameters:
      beforeJson - original document as JSON
      afterJson - target document as JSON
      Returns:
      computed delta result
      Throws:
      InvalidJsonException - if either JSON payload cannot be parsed
    • apply

      com.fasterxml.jackson.databind.JsonNode apply(com.fasterxml.jackson.databind.JsonNode before, DeltaResult delta)
      Applies a computed delta to a source document.
      Parameters:
      before - original document
      delta - previously computed delta
      Returns:
      reconstructed target document
      Throws:
      DeltaApplyException - if replay fails